Fixed some bugs in the website module.
| | |
| | | exec('crontab -u root -l > crontab.txt'); |
| | | $existing_root_cron_jobs = file('crontab.txt'); |
| | | |
| | | $root_cron_jobs = array('* * * * * /usr/bin/php -q /usr/local/ispconfig/server/server.php &> /dev/null'); |
| | | $root_cron_jobs = array('* * * * * /usr/bin/php -q /usr/local/ispconfig/server/server.sh &> /dev/null'); |
| | | foreach($root_cron_jobs as $cron_job) { |
| | | if(!in_array($cron_job."\n", $existing_root_cron_jobs)) { |
| | | $existing_root_cron_jobs[] = $cron_job."\n"; |
| | |
| | | `limit_spamfilter_wblist` int(11) NOT NULL default '0', |
| | | `limit_spamfilter_user` int(11) NOT NULL default '0', |
| | | `limit_spamfilter_policy` int(11) NOT NULL default '0', |
| | | `default_webserver` int(11) NOT NULL, |
| | | `limit_web_ip` text NOT NULL, |
| | | `default_webserver` int(11) NOT NULL default '1', |
| | | `limit_web_ip` text, |
| | | `limit_web_domain` int(11) NOT NULL default '-1', |
| | | `limit_web_subdomain` int(11) NOT NULL default '-1', |
| | | `limit_web_aliasdomain` int(11) NOT NULL default '-1', |
| | | `limit_ftp_user` int(11) NOT NULL default '-1', |
| | | `default_dnsserver` int(10) unsigned NOT NULL default '1', |
| | | `limit_dns_zone` int(11) NOT NULL default '-1', |
| | | `limit_dns_record` int(11) NOT NULL default '-1', |
| | | `username` varchar(255) default NULL, |
| | | `password` varchar(255) default NULL, |
| | | `language` varchar(255) NOT NULL default 'en', |
| | |
| | | |
| | | if(is_array($record_new) && count($record_new) > 0) { |
| | | foreach($record_new as $key => $val) { |
| | | if($record_old[$key] != $val) { |
| | | if(@$record_old[$key] != $val) { |
| | | // Record has changed |
| | | $diffrec[$key] = array('old' => $record_old[$key], |
| | | $diffrec[$key] = array('old' => @$record_old[$key], |
| | | 'new' => $val); |
| | | } |
| | | } |
| | |
| | | global $app, $conf; |
| | | |
| | | // Get the record of the parent domain |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval(@$this->dataRecord["parent_domain_id"])); |
| | | |
| | | // Set a few fixed values |
| | | $this->dataRecord["type"] = 'alias'; |
| | |
| | | $client_select = "<option value='0'></option>"; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':''; |
| | | $selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n"; |
| | | } |
| | | } |
| | |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client_id = intval($client["client_id"]); |
| | | } else { |
| | | $client_id = intval($web_rec["client_group_id"]); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"])); |
| | | $client_id = intval(@$web_rec["client_group_id"]); |
| | | $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval(@$this->dataRecord["client_group_id"])); |
| | | $client_id = intval($client["client_id"]); |
| | | } |
| | | |
| | |
| | | global $app, $conf; |
| | | |
| | | // Get the record of the parent domain |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval(@$this->dataRecord["parent_domain_id"])); |
| | | |
| | | // remove the parent domain part of the domain name before we show it in the text field. |
| | | $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]); |
| | |
| | | global $app, $conf; |
| | | |
| | | // Get the record of the parent domain |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"])); |
| | | $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval(@$this->dataRecord["parent_domain_id"])); |
| | | |
| | | // Set a few fixed values |
| | | $this->dataRecord["type"] = 'subdomain'; |
| | |
| | | if(!is_dir($data["new"]["document_root"]."/cgi-bin")) exec("mkdir -p ".$data["new"]["document_root"]."/cgi-bin"); |
| | | |
| | | // Create the symlink for the logfiles |
| | | if(!is_dir('/var/log/ispconfig/httpd/'.$data["new"]["domain"])) exec('mkdir -p /var/log/ispconfig/httpd/'.$data["new"]["domain"]); |
| | | if(!is_link($data["new"]["document_root"]."/log")) exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log"); |
| | | |
| | | // TODO: Create the symlinks |