| | |
| | | unset($tmp); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client['client_id'])); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | |
| | | unset($ips); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | |
| | | if(trim($rewrite_rule_line) == '') continue; |
| | | // rewrite |
| | | if(preg_match('@^\s*rewrite\s+(^/)?\S+(\$)?\s+\S+(\s+(last|break|redirect|permanent|))?\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | if(preg_match('@^\s*rewrite\s+(^/)?(\'[^\']+\'|"[^"]+")+(\$)?\s+(\'[^\']+\'|"[^"]+")+(\s+(last|break|redirect|permanent|))?\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | if(preg_match('@^\s*rewrite\s+(^/)?(\'[^\']+\'|"[^"]+")+(\$)?\s+\S+(\s+(last|break|redirect|permanent|))?\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | if(preg_match('@^\s*rewrite\s+(^/)?\S+(\$)?\s+(\'[^\']+\'|"[^"]+")+(\s+(last|break|redirect|permanent|))?\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | // if |
| | | if(preg_match('@^\s*if\s+\(\s*\$\S+(\s+(\!?(=|~|~\*))\s+(\S+|\".+\"))?\s*\)\s*\{\s*$@', $rewrite_rule_line)){ |
| | | $if_level += 1; |
| | |
| | | |
| | | if(!$rewrites_are_valid || $if_level != 0){ |
| | | $app->tform->errorMessage .= $app->tform->lng("invalid_rewrite_rules_txt").'<br>'; |
| | | } |
| | | } |
| | | |
| | | // check custom php.ini settings |
| | | if(isset($this->dataRecord['custom_php_ini']) && trim($this->dataRecord['custom_php_ini']) != '') { |
| | | $custom_php_ini_settings = trim($this->dataRecord['custom_php_ini']); |
| | | $custom_php_ini_settings_are_valid = true; |
| | | // Make sure we only have Unix linebreaks |
| | | $custom_php_ini_settings = str_replace("\r\n", "\n", $custom_php_ini_settings); |
| | | $custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings); |
| | | $custom_php_ini_settings_lines = explode("\n", $custom_php_ini_settings); |
| | | if(is_array($custom_php_ini_settings_lines) && !empty($custom_php_ini_settings_lines)){ |
| | | foreach($custom_php_ini_settings_lines as $custom_php_ini_settings_line){ |
| | | if(trim($custom_php_ini_settings_line) == '') continue; |
| | | if(substr(trim($custom_php_ini_settings_line),0,1) == ';') continue; |
| | | // empty value |
| | | if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*;*\s*$@', $custom_php_ini_settings_line)) continue; |
| | | // value inside "" |
| | | if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*".*"\s*;*\s*$@', $custom_php_ini_settings_line)) continue; |
| | | // value inside '' |
| | | if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*\'.*\'\s*;*\s*$@', $custom_php_ini_settings_line)) continue; |
| | | // everything else |
| | | if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\s]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue; |
| | | $custom_php_ini_settings_are_valid = false; |
| | | break; |
| | | } |
| | | } |
| | | if(!$custom_php_ini_settings_are_valid){ |
| | | $app->tform->errorMessage .= $app->tform->lng("invalid_custom_php_ini_settings_txt").'<br>'; |
| | | } |
| | | } |
| | | |
| | |
| | | //* Change database backup options when web backup options have been changed |
| | | if(isset($this->dataRecord['backup_interval']) && ($this->dataRecord['backup_interval'] != $this->oldDataRecord['backup_interval'] || $this->dataRecord['backup_copies'] != $this->oldDataRecord['backup_copies'])) { |
| | | //* Update all databases |
| | | $backup_interval = $app->functions->intval($this->dataRecord['backup_interval']); |
| | | $backup_interval = $app->db->quote($this->dataRecord['backup_interval']); |
| | | $backup_copies = $app->functions->intval($this->dataRecord['backup_copies']); |
| | | $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$this->id); |
| | | foreach($records as $rec) { |