make sure we fill all context parameters in any case
This commit is contained in:
@@ -23,13 +23,13 @@ class HttpConfigBase {
|
|||||||
* @param $template
|
* @param $template
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function processSpecialConfigTemplate($template, $ipandport, $domain) {
|
protected function processSpecialConfigTemplate($template, $domain, $ip, $port, $is_ssl_vhost) {
|
||||||
$templateVars = array(
|
$templateVars = array(
|
||||||
'DOMAIN' => $domain['domain'],
|
'DOMAIN' => $domain['domain'],
|
||||||
'CUSTOMER' => $domain['loginname'],
|
'CUSTOMER' => $domain['loginname'],
|
||||||
'IP' => $ipandport['ip'],
|
'IP' => $ip,
|
||||||
'PORT' => $ipandport['port'],
|
'PORT' => $port,
|
||||||
'IS_SSL' => ($domain['ssl'])?'ssl':'',
|
'IS_SSL' => ($is_ssl_vhost)?'ssl':'',
|
||||||
'DOCROOT' => $domain['documentroot']
|
'DOCROOT' => $domain['documentroot']
|
||||||
);
|
);
|
||||||
return replace_variables($template, $templateVars);
|
return replace_variables($template, $templateVars);
|
||||||
|
|||||||
@@ -318,8 +318,10 @@ class apache extends HttpConfigBase {
|
|||||||
if ($row_ipsandports['specialsettings'] != '') {
|
if ($row_ipsandports['specialsettings'] != '') {
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= $this->processSpecialConfigTemplate(
|
$this->virtualhosts_data[$vhosts_filename] .= $this->processSpecialConfigTemplate(
|
||||||
$row_ipsandports['specialsettings'],
|
$row_ipsandports['specialsettings'],
|
||||||
$row_ipsandports,
|
$domain,
|
||||||
$domain) . "\n";
|
$row_ipsandports['ip'],
|
||||||
|
$row_ipsandports['port'],
|
||||||
|
$row_ipsandports['ssl'] == '1') . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row_ipsandports['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
|
if ($row_ipsandports['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
|
||||||
@@ -689,8 +691,10 @@ class apache extends HttpConfigBase {
|
|||||||
if ($ipandport['default_vhostconf_domain'] != '') {
|
if ($ipandport['default_vhostconf_domain'] != '') {
|
||||||
$_vhost_content .= $this->processSpecialConfigTemplate(
|
$_vhost_content .= $this->processSpecialConfigTemplate(
|
||||||
$ipandport['default_vhostconf_domain'],
|
$ipandport['default_vhostconf_domain'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain) . "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
$ipportlist .= $ipport;
|
$ipportlist .= $ipport;
|
||||||
}
|
}
|
||||||
@@ -802,8 +806,10 @@ class apache extends HttpConfigBase {
|
|||||||
if ($domain['specialsettings'] != '') {
|
if ($domain['specialsettings'] != '') {
|
||||||
$vhost_content .= $this->processSpecialConfigTemplate(
|
$vhost_content .= $this->processSpecialConfigTemplate(
|
||||||
$domain['specialsettings'],
|
$domain['specialsettings'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain) . "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_vhost_content != '') {
|
if ($_vhost_content != '') {
|
||||||
@@ -813,8 +819,10 @@ class apache extends HttpConfigBase {
|
|||||||
if (Settings::Get('system.default_vhostconf') != '') {
|
if (Settings::Get('system.default_vhostconf') != '') {
|
||||||
$vhost_content .= $this->processSpecialConfigTemplate(
|
$vhost_content .= $this->processSpecialConfigTemplate(
|
||||||
Settings::Get('system.default_vhostconf'),
|
Settings::Get('system.default_vhostconf'),
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain) . "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,8 +149,10 @@ class lighttpd extends HttpConfigBase {
|
|||||||
if ($row_ipsandports['specialsettings'] != '') {
|
if ($row_ipsandports['specialsettings'] != '') {
|
||||||
$this->lighttpd_data[$vhost_filename].= $this->processSpecialConfigTemplate(
|
$this->lighttpd_data[$vhost_filename].= $this->processSpecialConfigTemplate(
|
||||||
$row_ipsandports['specialsettings'],
|
$row_ipsandports['specialsettings'],
|
||||||
$row_ipsandports,
|
$domain,
|
||||||
$domain
|
$row_ipsandports['ip'],
|
||||||
|
$row_ipsandports['port'],
|
||||||
|
$row_ipsandports['ssl'] == '1'
|
||||||
). "\n";
|
). "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,22 +449,28 @@ class lighttpd extends HttpConfigBase {
|
|||||||
if ($domain['specialsettings'] != "") {
|
if ($domain['specialsettings'] != "") {
|
||||||
$vhost_content.= $this->processSpecialConfigTemplate(
|
$vhost_content.= $this->processSpecialConfigTemplate(
|
||||||
$domain['specialsettings'],
|
$domain['specialsettings'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain). "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost). "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ipandport['default_vhostconf_domain'] != '') {
|
if ($ipandport['default_vhostconf_domain'] != '') {
|
||||||
$vhost_content.= $this->processSpecialConfigTemplate(
|
$vhost_content.= $this->processSpecialConfigTemplate(
|
||||||
$ipandport['default_vhostconf_domain'],
|
$ipandport['default_vhostconf_domain'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain) . "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings::Get('system.default_vhostconf') != '') {
|
if (Settings::Get('system.default_vhostconf') != '') {
|
||||||
$vhost_content.= $this->processSpecialConfigTemplate(
|
$vhost_content.= $this->processSpecialConfigTemplate(
|
||||||
Settings::Get('system.default_vhostconf'),
|
Settings::Get('system.default_vhostconf'),
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain). "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost). "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$vhost_content.= $this->getLogFiles($domain);
|
$vhost_content.= $this->getLogFiles($domain);
|
||||||
|
|||||||
@@ -191,10 +191,12 @@ class nginx extends HttpConfigBase {
|
|||||||
if ($row_ipsandports['specialsettings'] != '') {
|
if ($row_ipsandports['specialsettings'] != '') {
|
||||||
$this->nginx_data[$vhost_filename].= $this->processSpecialConfigTemplate(
|
$this->nginx_data[$vhost_filename].= $this->processSpecialConfigTemplate(
|
||||||
$row_ipsandports['specialsettings'],
|
$row_ipsandports['specialsettings'],
|
||||||
$row_ipsandports,
|
|
||||||
array('domain'=> Settings::Get('system.hostname'),
|
array('domain'=> Settings::Get('system.hostname'),
|
||||||
'loginname' => Settings::Get('phpfpm.vhost_httpuser'),
|
'loginname' => Settings::Get('phpfpm.vhost_httpuser'),
|
||||||
'documentroot'=> $mypath)). "\n";
|
'documentroot'=> $mypath),
|
||||||
|
$row_ipsandports['ip'],
|
||||||
|
$row_ipsandports['port'],
|
||||||
|
$row_ipsandports['ssl'] == '1'). "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -372,8 +374,10 @@ class nginx extends HttpConfigBase {
|
|||||||
if ($ipandport['default_vhostconf_domain'] != '') {
|
if ($ipandport['default_vhostconf_domain'] != '') {
|
||||||
$_vhost_content .= $this->processSpecialConfigTemplate(
|
$_vhost_content .= $this->processSpecialConfigTemplate(
|
||||||
$ipandport['default_vhostconf_domain'],
|
$ipandport['default_vhostconf_domain'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain). "\n";
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost). "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$vhost_content.= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ';' . "\n";
|
$vhost_content.= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ';' . "\n";
|
||||||
@@ -437,8 +441,10 @@ class nginx extends HttpConfigBase {
|
|||||||
if ($domain['specialsettings'] != "") {
|
if ($domain['specialsettings'] != "") {
|
||||||
$vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate(
|
$vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate(
|
||||||
$domain['specialsettings'],
|
$domain['specialsettings'],
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,8 +456,10 @@ class nginx extends HttpConfigBase {
|
|||||||
$vhost_content = $this->mergeVhostCustom($vhost_content,
|
$vhost_content = $this->mergeVhostCustom($vhost_content,
|
||||||
$this->processSpecialConfigTemplate(
|
$this->processSpecialConfigTemplate(
|
||||||
Settings::Get('system.default_vhostconf'),
|
Settings::Get('system.default_vhostconf'),
|
||||||
$ipandport,
|
$domain,
|
||||||
$domain)."\n");
|
$domain['ip'],
|
||||||
|
$domain['port'],
|
||||||
|
$ssl_vhost)."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user