['.$php_directive_snippet['name'].']'.htmlentities($php_directive_snippet['snippet']).'
';
}
}
if($php_directive_snippets_txt == '') $php_directive_snippets_txt = '------';
$app->tpl->setVar("php_directive_snippets_txt", $php_directive_snippets_txt);
if($server_type == 'apache'){
$apache_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'apache' AND active = 'y'");
$apache_directive_snippets_txt = '';
if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
foreach($apache_directive_snippets as $apache_directive_snippet){
$apache_directive_snippets_txt .= '['.$apache_directive_snippet['name'].']'.htmlentities($apache_directive_snippet['snippet']).'
';
}
}
if($apache_directive_snippets_txt == '') $apache_directive_snippets_txt = '------';
$app->tpl->setVar("apache_directive_snippets_txt", $apache_directive_snippets_txt);
}
if($server_type == 'nginx'){
$nginx_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'nginx' AND active = 'y'");
$nginx_directive_snippets_txt = '';
if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
foreach($nginx_directive_snippets as $nginx_directive_snippet){
$nginx_directive_snippets_txt .= '['.$nginx_directive_snippet['name'].']'.htmlentities($nginx_directive_snippet['snippet']).'
';
}
}
if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
$app->tpl->setVar("nginx_directive_snippets_txt", $nginx_directive_snippets_txt);
}
$proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
$proxy_directive_snippets_txt = '';
if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
foreach($proxy_directive_snippets as $proxy_directive_snippet){
$proxy_directive_snippets_txt .= '['.$proxy_directive_snippet['name'].']'.htmlentities($proxy_directive_snippet['snippet']).'
';
}
}
if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
$app->tpl->setVar("proxy_directive_snippets_txt", $proxy_directive_snippets_txt);
}
//* Admin: If the logged in user is admin
} else {
if($this->_vhostdomain_type == 'domain') {
// The user is admin, so we fill in all IP addresses of the server
if($this->id > 0) {
if(!isset($this->dataRecord["server_id"])){
$tmp = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
$this->dataRecord["server_id"] = $tmp["server_id"];
unset($tmp);
}
$server_id = intval(@$this->dataRecord["server_id"]);
} else {
// Get the first server ID
$tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1");
$server_id = intval($tmp['server_id']);
}
//* get global web config
$web_config = $app->getconf->get_server_config($server_id, 'web');
} else {
//* get global web config
$web_config = $app->getconf->get_server_config($parent_domain['server_id'], 'web');
}
//* Fill the IPv4 select field
$sql = "SELECT ip_address FROM server_ip WHERE ip_type = 'IPv4' AND server_id = ".$app->functions->intval($server_id);
$ips = $app->db->queryAllRecords($sql);
$ip_select = ($web_config['enable_ip_wildcard'] == 'y')?"['.$php_directive_snippet['name'].']'.htmlentities($php_directive_snippet['snippet']).'
';
}
}
if($php_directive_snippets_txt == '') $php_directive_snippets_txt = '------';
$app->tpl->setVar("php_directive_snippets_txt", $php_directive_snippets_txt);
if($server_type == 'apache'){
$apache_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'apache' AND active = 'y'");
$apache_directive_snippets_txt = '';
if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
foreach($apache_directive_snippets as $apache_directive_snippet){
$apache_directive_snippets_txt .= '['.$apache_directive_snippet['name'].']'.htmlentities($apache_directive_snippet['snippet']).'
';
}
}
if($apache_directive_snippets_txt == '') $apache_directive_snippets_txt = '------';
$app->tpl->setVar("apache_directive_snippets_txt", $apache_directive_snippets_txt);
}
if($server_type == 'nginx'){
$nginx_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'nginx' AND active = 'y'");
$nginx_directive_snippets_txt = '';
if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
foreach($nginx_directive_snippets as $nginx_directive_snippet){
$nginx_directive_snippets_txt .= '['.$nginx_directive_snippet['name'].']'.htmlentities($nginx_directive_snippet['snippet']).'
';
}
}
if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
$app->tpl->setVar("nginx_directive_snippets_txt", $nginx_directive_snippets_txt);
}
$proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
$proxy_directive_snippets_txt = '';
if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
foreach($proxy_directive_snippets as $proxy_directive_snippet){
$proxy_directive_snippets_txt .= '['.$proxy_directive_snippet['name'].']'.htmlentities($proxy_directive_snippet['snippet']).'
';
}
}
if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
$app->tpl->setVar("proxy_directive_snippets_txt", $proxy_directive_snippets_txt);
}
$ssl_domain_select = '';
$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ".$this->id);
$ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"], '*.'.$tmp["domain"]);
if(is_array($ssl_domains)) {
foreach( $ssl_domains as $ssl_domain) {
$selected = ($ssl_domain == $this->dataRecord['ssl_domain'])?'SELECTED':'';
$ssl_domain_select .= "