Introduced phpenabled_customer and phpenabled_vhost, updated cron scripts, updated dbversion

This commit is contained in:
Dominic Schallert
2016-11-13 15:15:43 +01:00
parent 1519db1637
commit e5053bad15
9 changed files with 21 additions and 22 deletions

View File

@@ -578,7 +578,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('panel', 'password_special_char', '!?<>§$%+#=@'), ('panel', 'password_special_char', '!?<>§$%+#=@'),
('panel', 'customer_hide_options', ''), ('panel', 'customer_hide_options', ''),
('panel', 'version', '0.9.38-rc2'), ('panel', 'version', '0.9.38-rc2'),
('panel', 'db_version', '201610070'); ('panel', 'db_version', '201611130');
DROP TABLE IF EXISTS `panel_tasks`; DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -3502,6 +3502,15 @@ if (isDatabaseVersion('201609240')) {
updateToDbVersion('201610070'); updateToDbVersion('201610070');
} }
if (isDatabaseVersion('201610070')) {
showUpdateStep("Updating database table definition for panel_domains");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `phpenabled` tinyint(1) NOT NULL default '1' AFTER `parentdomainid`;");
lastStepStatus(0);
updateToDbVersion('201611130');
}
if (isFroxlorVersion('0.9.37')) { if (isFroxlorVersion('0.9.37')) {
showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false); showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false);
@@ -3513,14 +3522,3 @@ if (isFroxlorVersion('0.9.38-rc1')) {
showUpdateStep("Updating from 0.9.38-rc1 to 0.9.38-rc2", false); showUpdateStep("Updating from 0.9.38-rc1 to 0.9.38-rc2", false);
updateToVersion('0.9.38-rc2'); updateToVersion('0.9.38-rc2');
} }
if (isFroxlorVersion('0.9.38-rc2')) {
showUpdateStep("Updating from 0.9.38-rc2 to 0.9.38-rc3", false);
showUpdateStep("Updating database table definition for panel_domains");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `phpenabled` tinyint(1) NOT NULL default '1' AFTER `parentdomainid`;");
lastStepStatus(0);
updateToVersion('0.9.38-rc3');
}

View File

@@ -31,8 +31,9 @@ class WebserverBase {
$query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, $query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`,
`d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`, `d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`,
`c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`,
`c`.`phpenabled` AS `phpenabled`, `d`.`mod_fcgid_starter`, `c`.`phpenabled` AS `phpenabled_customer`,
`d`.`mod_fcgid_maxrequests` `d`.`phpenabled` AS `phpenabled_vhost`,
`d`.`mod_fcgid_starter`,`d`.`mod_fcgid_maxrequests`
FROM `".TABLE_PANEL_DOMAINS."` `d` FROM `".TABLE_PANEL_DOMAINS."` `d`
LEFT JOIN `".TABLE_PANEL_CUSTOMERS."` `c` USING(`customerid`) LEFT JOIN `".TABLE_PANEL_CUSTOMERS."` `c` USING(`customerid`)

View File

@@ -19,7 +19,7 @@
$version = '0.9.38-rc2'; $version = '0.9.38-rc2';
// Database version (YYYYMMDDC where C is a daily counter) // Database version (YYYYMMDDC where C is a daily counter)
$dbversion = '201610070'; $dbversion = '201611130';
// Distribution branding-tag (used for Debian etc.) // Distribution branding-tag (used for Debian etc.)
$branding = ''; $branding = '';

View File

@@ -488,7 +488,7 @@ class apache extends HttpConfigBase
{ {
$php_options_text = ''; $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 // This vHost has PHP enabled and we are using the regular mod_php
if ($domain['openbasedir'] == '1') { if ($domain['openbasedir'] == '1') {

View File

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

View File

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

View File

@@ -838,7 +838,7 @@ class nginx extends HttpConfigBase
protected function composePhpOptions($domain, $ssl_vhost = false) protected function composePhpOptions($domain, $ssl_vhost = false)
{ {
$phpopts = ''; $phpopts = '';
if ($domain['phpenabled'] == '1') { if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$phpopts = "\tlocation ~ \.php {\n"; $phpopts = "\tlocation ~ \.php {\n";
$phpopts .= "\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n"; $phpopts .= "\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
$phpopts .= "\t" . '}' . "\n\n"; $phpopts .= "\t" . '}' . "\n\n";
@@ -874,7 +874,7 @@ class nginx extends HttpConfigBase
$webroot_text .= "\n\t" . 'location / {' . "\n"; $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" . 'index index.php index.html index.htm;' . "\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n"; $webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
} else { } else {
@@ -887,7 +887,7 @@ class nginx extends HttpConfigBase
} }
$webroot_text .= "\t" . '}' . "\n\n"; $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 .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n"; $webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n"; $webroot_text .= "\t}\n\n";

View File

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