Vhost templates: Extended the cron scripts to check for the designated webserver and referential integrity
This commit is contained in:
@@ -868,9 +868,11 @@ class apache extends HttpConfigBase {
|
||||
|
||||
// check if vhost config template is set and if so, merge it
|
||||
if ($domain['vhostsettingid'] != 0) {
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;");
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . "
|
||||
WHERE `webserver` = 'apache2' AND `id` = :id LIMIT 1;");
|
||||
$vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid']));
|
||||
|
||||
if (is_array($vhostconfig)) {
|
||||
$vhost_content .= $this->processSpecialConfigTemplate(
|
||||
$vhostconfig['vhostsettings'],
|
||||
$domain,
|
||||
@@ -878,6 +880,7 @@ class apache extends HttpConfigBase {
|
||||
$domain['port'],
|
||||
$ssl_vhost) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain['specialsettings'] != '') {
|
||||
$vhost_content .= $this->processSpecialConfigTemplate(
|
||||
|
||||
@@ -457,9 +457,11 @@ class lighttpd extends HttpConfigBase {
|
||||
|
||||
// check if vhost config template is set and if so, merge it
|
||||
if ($domain['vhostsettingid'] != 0) {
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;");
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . "
|
||||
WHERE `webserver` = 'lighttpd' AND `id` = :id LIMIT 1;");
|
||||
$vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid']));
|
||||
|
||||
if (is_array($vhostconfig)) {
|
||||
$vhost_content .= $this->processSpecialConfigTemplate(
|
||||
$vhostconfig['vhostsettings'],
|
||||
$domain,
|
||||
@@ -467,6 +469,7 @@ class lighttpd extends HttpConfigBase {
|
||||
$domain['port'],
|
||||
$ssl_vhost) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain['specialsettings'] != "") {
|
||||
$vhost_content.= $this->processSpecialConfigTemplate(
|
||||
|
||||
@@ -446,9 +446,11 @@ class nginx extends HttpConfigBase {
|
||||
|
||||
// check if vhost config template is set and if so, merge it
|
||||
if ($domain['vhostsettingid'] != 0) {
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;");
|
||||
$vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . "
|
||||
WHERE `webserver` = 'nginx' AND `id` = :id LIMIT 1;");
|
||||
$vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid']));
|
||||
|
||||
if (is_array($vhostconfig)) {
|
||||
// replace {SOCKET} var with unix socket
|
||||
$php = new phpinterface($domain);
|
||||
$vhostconfig['vhostsettings'] = str_replace("{SOCKET}", $php->getInterface()->getSocketFile(), $vhostconfig['vhostsettings']);
|
||||
@@ -461,6 +463,7 @@ class nginx extends HttpConfigBase {
|
||||
$ssl_vhost
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain['specialsettings'] != "") {
|
||||
$vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate(
|
||||
|
||||
Reference in New Issue
Block a user