From 373cb912d85ca09eac8224760d94fe34af309ff9 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Fri, 26 Feb 2016 19:08:08 +0100 Subject: [PATCH] - Hide the option on whether to include default directives with webservers different than nginx - Typo fix - Indentation fix --- admin_domains.php | 10 +++++----- install/updates/froxlor/0.9/update_0.9.inc.php | 10 +++++----- lib/formfields/admin/domains/formfield.domains_add.php | 1 + .../admin/domains/formfield.domains_edit.php | 3 ++- lng/english.lng.php | 2 +- lng/german.lng.php | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/admin_domains.php b/admin_domains.php index 39c11176..88d21a94 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -97,7 +97,7 @@ if ($page == 'domains' } $row['ipandport'] = substr($row['ipandport'], 0, -1); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); - + if($row['termination_date'] != "") { $cdate = strtotime($row['termination_date'] . " 23:59:59"); @@ -434,7 +434,7 @@ if ($page == 'domains' } $vhostsettingid = 0; - $vhost_usedefaultlocation = 0; + $vhost_usedefaultlocation = 1; if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1' ) { @@ -446,7 +446,7 @@ if ($page == 'domains' ) { $phpsettingid = (int)$_POST['phpsettingid']; $vhostsettingid = (int)$_POST['vhostsettingid']; - $vhost_usedefaultlocation = (int)$_POST['vhost_usedefaultlocation']; + $vhost_usedefaultlocation = isset($_POST['vhost_usedefaultlocation']) ? (int)$_POST['vhost_usedefaultlocation'] : 1; $phpsettingid_check_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :phpsettingid" @@ -1288,7 +1288,7 @@ if ($page == 'domains' ) { $phpsettingid = (int)$_POST['phpsettingid']; $vhostsettingid = (int)$_POST['vhostsettingid']; - $vhost_usedefaultlocation = (int)$_POST['vhost_usedefaultlocation']; + $vhost_usedefaultlocation = isset($_POST['vhost_usedefaultlocation']) ? (int)$_POST['vhost_usedefaultlocation'] : $vhost_usedefaultlocation; $phpsettingid_check_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :phpid "); @@ -1979,7 +1979,7 @@ if ($page == 'domains' // Fudge the result for ssl_redirect to hide the Let's Encrypt steps $result['temporary_ssl_redirect'] = $result['ssl_redirect']; $result['ssl_redirect'] = ($result['ssl_redirect'] == 0 ? 0 : 1); - + $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_wildcard'], '0', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_www'], '1', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_none'], '2', $_value, true, true); diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 73432db0..d68a85b5 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -3103,11 +3103,11 @@ if (isFroxlorVersion('0.9.35-dev5')) { showUpdateStep("Adding new panel_vhostconfigs table"); Database::query("DROP TABLE IF EXISTS `panel_vhostconfigs`;"); $sql = "CREATE TABLE `" . TABLE_PANEL_VHOSTCONFIGS . "` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(50) NOT NULL, - `vhostsettings` text NOT NULL, - PRIMARY KEY (`id`) - ) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;"; + `id` int(11) NOT NULL AUTO_INCREMENT, + `description` varchar(50) NOT NULL, + `vhostsettings` text NOT NULL, + PRIMARY KEY (`id`) + ) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;"; Database::query($sql); lastStepStatus(0); diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index 9e4360ba..39a2de97 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -151,6 +151,7 @@ return array( 'value' => array() ), 'vhost_usedefaultlocation' => array( + 'visible' => (Settings::Get('system.webserver') == 'nginx' ? true : false), 'label' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'], 'desc' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'], 'type' => 'checkbox', diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index 6a6b3849..e72bf5f8 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -84,7 +84,7 @@ return array( 'value' => $result['registration_date'], 'size' => 10 ), - 'termination_date' => array( + 'termination_date' => array( 'label' => $lng['domains']['termination_date'], 'desc' => $lng['panel']['dateformat'], 'type' => 'text', @@ -163,6 +163,7 @@ return array( 'value' => array($result['speciallogfile']) ), 'vhost_usedefaultlocation' => array( + 'visible' => (Settings::Get('system.webserver') == 'nginx' ? true : false), 'label' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'], 'desc' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'], 'type' => 'checkbox', diff --git a/lng/english.lng.php b/lng/english.lng.php index d593efec..fe574774 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1985,5 +1985,5 @@ $lng['admin']['vhostconfig']['ip'] = 'Will be replaced with the IP address of th $lng['admin']['vhostconfig']['port'] = 'Will be replaced with the port number of the Vhost.'; $lng['admin']['vhostconfig']['scheme'] = 'Will be set to http or https in case SSL / TLS is activated for the Vhost.'; $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'] = 'Use the standard Vhost location directives'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'If activated, the standard Vhost location directives, such as
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
are excluded from the Vhost configuration file.'; +$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'If deactivated, the standard Vhost location directives, such as
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
are excluded from the Vhost configuration file.'; $lng['question']['vhostsetting_reallydelete'] = 'Do you really want to delete the Vhost template?'; \ No newline at end of file diff --git a/lng/german.lng.php b/lng/german.lng.php index 87813fd1..d547254d 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1625,5 +1625,5 @@ $lng['admin']['vhostconfig']['ip'] = 'Wird mit der IP-Adresse des Vhosts ersetzt $lng['admin']['vhostconfig']['port'] = 'Wird mit dem Port des Vhosts ersetzt.'; $lng['admin']['vhostconfig']['scheme'] = 'Wird mit http bzw. mit https ersetzt, sofern der Vhost SSL/TLS aktiviert hat.'; $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'] = 'Standard VHost location-Direktiven verwenden'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'Wenn aktiviert, werden die Standard VHost-Direktiven wie
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
nicht in die Konfigurationsdatei geschrieben.'; +$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'Wenn deaktiviert, werden Standard VHost-Direktiven wie
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
nicht in die Konfigurationsdatei geschrieben.'; $lng['question']['vhostsetting_reallydelete'] = 'Wollen Sie diese VHost-Vorlage wirklich löschen?'; \ No newline at end of file