diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index ec92ae1c..b30a6cbd 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -194,6 +194,14 @@ return array( 'default' => false, 'save_method' => 'storeSettingField', ), + 'panel_phpconfigs_hidestdsubdomain' => array( + 'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'], + 'settinggroup' => 'panel', + 'varname' => 'phpconfigs_hidestdsubdomain', + 'type' => 'bool', + 'default' => false, + 'save_method' => 'storeSettingField', + ), ), ), ), diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 88736c9b..cb093299 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -25,47 +25,54 @@ define('AREA', 'admin'); require ("./lib/init.php"); -if(isset($_POST['id'])) -{ +if (isset($_POST['id'])) { $id = intval($_POST['id']); -} -elseif(isset($_GET['id'])) -{ +} elseif (isset($_GET['id'])) { $id = intval($_GET['id']); } -if($page == 'overview') -{ - if($action == '') - { +if ($page == 'overview') { + + if ($action == '') { + $tablecontent = ''; $count = 0; $result = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`"); - while($row = $db->fetch_array($result)) - { + while ($row = $db->fetch_array($result)) { + $domainresult = false; - if((int)$userinfo['domains_see_all'] == 0) - { - $domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `adminid` = " . (int)$userinfo['userid'] . " AND `phpsettingid` = " . (int)$row['id']); - } - else - { - $domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `phpsettingid` = " . (int)$row['id']); + $query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."` + WHERE `phpsettingid` = '".(int)$row['id']."' + AND `parentdomainid` = '0'"; + + if ((int)$userinfo['domains_see_all'] == 0) { + $query .= " AND `adminid` = '".(int)$userinfo['userid']."'"; } - $domains = ''; - - if($db->num_rows($domainresult) > 0) - { - while($row2 = $db->fetch_array($domainresult)) - { - $domains.= $row2['domain'] . ''; + if ((int)$settings['panel']['phpconfigs_hidestdsubdomain'] == 1) { + $query2 = "SELECT DISTINCT `standardsubdomain` + FROM `".TABLE_PANEL_CUSTOMERS."` + WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;"; + $ssdids_res = $db->query($query2); + $ssdids = array(); + while ($ssd = $db->fetch_array($ssdids_res)) { + $ssdids[] = $ssd['standardsubdomain']; + } + if (count($ssdids) > 0) { + $query .= " AND `id` NOT IN (".implode(', ', $ssdids).")"; } } - else - { + + $domainresult = $db->query($query); + + $domains = ''; + if ($db->num_rows($domainresult) > 0) { + while ($row2 = $db->fetch_array($domainresult)) { + $domains.= $row2['domain'] . ''; + } + } else { $domains = $lng['admin']['phpsettings']['notused']; } diff --git a/install/froxlor.sql b/install/froxlor.sql index e0b8febc..64229daf 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -534,7 +534,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_regex', ''), ('panel', 'use_webfonts', '0'), ('panel', 'webfont', 'Numans'), - ('panel', 'version', '0.9.28.1'); + ('panel', 'phpconfigs_hidestdsubdomain', '0'), + ('panel', 'version', '0.9.29-dev1'); 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 ddf81e77..8e5f321f 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2052,3 +2052,15 @@ if (isFroxlorVersion('0.9.28')) { lastStepStatus(0); updateToVersion('0.9.28.1'); } + +if(isFroxlorVersion('0.9.28.1')) { + showUpdateStep("Updating from 0.9.28.1 to 0.9.29-dev1", true); + lastStepStatus(0); + + $hide_stdsubdomains = isset($_POST['hide_stdsubdomains']) ? (int)$_POST['hide_stdsubdomains'] : '0'; + showUpdateStep('Setting value for "hide standard subdomains"', true); + $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'phpconfigs_hidestdsubdomain', '".$hide_stdsubdomains."');"); + lastStepStatus(0); + + updateToVersion('0.9.29-dev1'); +} \ No newline at end of file diff --git a/install/updates/preconfig.php b/install/updates/preconfig.php index b6c324b9..c51aea08 100644 --- a/install/updates/preconfig.php +++ b/install/updates/preconfig.php @@ -124,6 +124,7 @@ function version_compare2($a, $b) { } } + /* if (count($a) > count($b)) { if ($a[count($b)-1] == $b[count($b)-1]) { return -1; @@ -134,6 +135,7 @@ function version_compare2($a, $b) { return 1; } } + */ foreach ($a as $depth => $aVal) { // iterate over each piece of A diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index fbdd2ab7..0aff35a4 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -158,7 +158,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $question.= makeyesno('update_defdns_mailentry', '1', '0', '0'); eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } - + if(versionInUpdate($current_version, '0.9.10-svn1')) { $has_nouser = false; @@ -171,13 +171,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $has_nouser = true; $guessed_user = 'www-data'; if(function_exists('posix_getuid') - && function_exists('posix_getpwuid') + && function_exists('posix_getpwuid') ) { $_httpuser = posix_getpwuid(posix_getuid()); $guessed_user = $_httpuser['name']; } } - + $result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'"); if(!isset($result) || !isset($result['value'])) { @@ -185,7 +185,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $has_nogroup = true; $guessed_group = 'www-data'; if(function_exists('posix_getgid') - && function_exists('posix_getgrgid') + && function_exists('posix_getgrgid') ) { $_httpgroup = posix_getgrgid(posix_getgid()); $guessed_group = $_httpgroup['name']; @@ -198,8 +198,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) if($has_nouser) { $question = 'Please enter the webservers username: '; - } - elseif($has_nogroup) + } + elseif($has_nogroup) { $question2 = 'Please enter the webservers groupname: '; if($has_nouser) { @@ -238,7 +238,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $question.= ''; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } - + if(versionInUpdate($current_version, '0.9.12-svn1')) { if($settings['system']['mod_fcgid'] == 1) @@ -345,13 +345,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) } if(versionInUpdate($current_version, '0.9.14-svn10')) - { + { $has_preconfig = true; - $description = 'This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!'; + $description = 'This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!'; $question = ''; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } - + if(versionInUpdate($current_version, '0.9.16-svn1')) { $has_preconfig = true; @@ -419,7 +419,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) if(versionInUpdate($current_version, '0.9.18-svn2')) { $has_preconfig = true; - $description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.'; + $description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.'; $question = 'Select default panel theme: '; $question.= ''; $themes = getThemes(); @@ -458,7 +458,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $has_preconfig = true; $description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.'; $description.= 'LoadModule authz_core_module modules/mod_authz_core.so -LoadModule authz_host_module modules/mod_authz_host.so'; + LoadModule authz_host_module modules/mod_authz_host.so'; $question = 'Do you want to enable the Apache-2.4 modification?: '; $question.= makeyesno('update_system_apache24', '1', '0', '0'); eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); @@ -467,7 +467,7 @@ LoadModule authz_host_module modules/mod_authz_host.so'; $description = 'The path to nginx\'s fastcgi_params file is now customizable.'; $question = 'Please enter full path to you nginx/fastcgi_params file (including filename): '; $question.= ''; - eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } } @@ -503,4 +503,17 @@ LoadModule authz_host_module modules/mod_authz_host.so'; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } + + if (versionInUpdate($current_version, '0.9.29-dev1')) { + // we only need to ask if fcgid|php-fpm is enabled + if ($settings['system']['mod_fcgid'] == '1' + || $settings['phpfpm']['enabled'] == '1' + ) { + $has_preconfig = true; + $description = 'Standard-subdomains can now be hidden from the php-configuration overview.'; + $question = 'Do you want to hide the standard-subdomains (this can be changed in the settings any time)?: '; + $question.= makeyesno('hide_stdsubdomains', '1', '0', '0'); + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } + } } diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 24234b75..f04f9d53 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -73,6 +73,6 @@ define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.28.1'; +$version = '0.9.29-dev1'; $dbversion = '2'; $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index b0b3c57f..dcb5ba16 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1932,3 +1932,7 @@ $lng['error']['setlessthanalreadyused'] = 'You cannot set less resources of \'%s $lng['error']['stringmustntbeempty'] = 'The value for the field %s must not be empty'; $lng['admin']['domain_editable']['title'] = 'Allow editing of domain'; $lng['admin']['domain_editable']['desc'] = 'If set to yes, the customer is allowed to change several domain-settings.If set to no, nothing can be changed by the customer.'; + +// Added in Froxlor 0.9.29-dev1 +$lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['title'] = 'Hide standard-subdomains in PHP-configuration overview'; +$lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['description'] = 'If activated the standard-subdomains for customers will not be displayed in the php-configurations overviewNote: This is only visible if you have enabled FCGID or PHP-FPM'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 5ce89e01..35483e07 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1653,3 +1653,7 @@ $lng['error']['setlessthanalreadyused'] = 'Es können nicht weniger Resourcen vo $lng['error']['stringmustntbeempty'] = 'Der Wert für das Feld %s darf nicht leer sein'; $lng['admin']['domain_editable']['title'] = 'Erlaube Bearbeiten der Domain'; $lng['admin']['domain_editable']['desc'] = 'Wenn ja, darf der Kunde verschiedene Einstellungen anpassen.Wenn nein, darf nichts durch den Kunden geändert werden.'; + +// Added in Froxlor 0.9.29-dev1 +$lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['title'] = 'Verstecke Standard-Subdomains in PHP-Konfigurations-Übersicht'; +$lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['description'] = 'Wenn aktiviert, werden die Standard-Subdomains der Kunden nicht mehr in der PHP-Konfigurations-Übersicht angezeigt.Hinweis: Nur relevant, wenn FCGID oder PHP-FPM aktiviert ist.';
LoadModule authz_core_module modules/mod_authz_core.so -LoadModule authz_host_module modules/mod_authz_host.so