Merge branch 'master' into feature/letsencrypt-verbesserungen

This commit is contained in:
Michael Kaufmann
2016-12-11 08:23:46 +01:00
committed by GitHub
20 changed files with 145 additions and 64 deletions

View File

@@ -344,6 +344,15 @@ class apache extends HttpConfigBase
);
}
} // end of ssl-redirect check
else
{
// fallback of froxlor domain-data for processSpecialConfigTemplate()
$domain = array(
'domain' => Settings::Get('system.hostname'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
);
}
/**
* dirprotection, see #72
@@ -488,7 +497,7 @@ class apache extends HttpConfigBase
{
$php_options_text = '';
if ($domain['phpenabled'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
// This vHost has PHP enabled and we are using the regular mod_php
if ($domain['openbasedir'] == '1') {
@@ -808,7 +817,7 @@ class apache extends HttpConfigBase
$_sslport = ":" . $ssldestport['port'];
}
$domain['documentroot'] = 'https://' . $domain['domain'] . $_sslport . '/';
$domain['documentroot'] = 'https://%{HTTP_HOST}' . $_sslport . '/';
}
if ($ssl_vhost === true && $domain['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {

View File

@@ -23,7 +23,7 @@ class apache_fcgid extends apache
{
$php_options_text = '';
if($domain['phpenabled'] == '1')
if($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1')
{
$php = new phpinterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);

View File

@@ -162,7 +162,25 @@ class lighttpd extends HttpConfigBase
$this->lighttpd_data[$vhost_filename] .= "\t" . ')' . "\n";
$this->lighttpd_data[$vhost_filename] .= "\t" . ')' . "\n";
$this->lighttpd_data[$vhost_filename] .= ' )' . "\n";
} else {
$domain = array(
'id' => 'none',
'domain' => Settings::Get('system.hostname'),
'adminid' => 1, /* first admin-user (superadmin) */
'guid' => Settings::Get('system.httpuser'),
'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
);
}
} else {
// fallback of froxlor domain-data for processSpecialConfigTemplate()
$domain = array(
'domain' => Settings::Get('system.hostname'),
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
);
}
if ($row_ipsandports['specialsettings'] != '') {
@@ -424,7 +442,7 @@ class lighttpd extends HttpConfigBase
$_sslport = ":" . $ssldestport['port'];
}
$domain['documentroot'] = 'https://' . $domain['domain'] . $_sslport . '/';
$domain['documentroot'] = 'https://%1' . $_sslport . '/';
}
// avoid using any whitespaces

View File

@@ -21,7 +21,7 @@ class lighttpd_fcgid extends lighttpd
{
$php_options_text = '';
if($domain['phpenabled'] == '1')
if($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1')
{
$php = new phpinterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);

View File

@@ -447,7 +447,7 @@ class nginx extends HttpConfigBase
$_sslport = ":" . $ssldestport['port'];
}
$domain['documentroot'] = 'https://' . $domain['domain'] . $_sslport . '/';
$domain['documentroot'] = 'https://$host' . $_sslport . '/';
}
// avoid using any whitespaces
@@ -846,7 +846,7 @@ class nginx extends HttpConfigBase
protected function composePhpOptions($domain, $ssl_vhost = false)
{
$phpopts = '';
if ($domain['phpenabled'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$phpopts = "\tlocation ~ \.php {\n";
$phpopts .= "\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
$phpopts .= "\t" . '}' . "\n\n";
@@ -882,7 +882,7 @@ class nginx extends HttpConfigBase
$webroot_text .= "\n\t" . 'location / {' . "\n";
if ($domain['phpenabled'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$webroot_text .= "\t" . 'index index.php index.html index.htm;' . "\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
} else {
@@ -895,7 +895,7 @@ class nginx extends HttpConfigBase
}
$webroot_text .= "\t" . '}' . "\n\n";
if ($domain['phpenabled'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$webroot_text .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n";

View File

@@ -20,7 +20,7 @@ class nginx_phpfpm extends nginx
protected function composePhpOptions($domain, $ssl_vhost = false) {
$php_options_text = '';
if ($domain['phpenabled'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$php = new phpinterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);