Vhost templates: Extended the cron scripts to check for the designated webserver and referential integrity

This commit is contained in:
Johannes Feichtner
2016-02-27 20:19:50 +01:00
parent 088eef9728
commit 101e791add
3 changed files with 46 additions and 37 deletions

View File

@@ -868,15 +868,18 @@ 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']));
$vhost_content .= $this->processSpecialConfigTemplate(
$vhostconfig['vhostsettings'],
$domain,
$domain['ip'],
$domain['port'],
$ssl_vhost) . "\n";
if (is_array($vhostconfig)) {
$vhost_content .= $this->processSpecialConfigTemplate(
$vhostconfig['vhostsettings'],
$domain,
$domain['ip'],
$domain['port'],
$ssl_vhost) . "\n";
}
}
if ($domain['specialsettings'] != '') {