diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index b30a6cbd..cd0a0eb3 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -33,7 +33,7 @@ return array( 'save_method' => 'storeSettingField', ), 'panel_default_theme' => array( - 'label' => $lng['serversettings']['default_theme'], + 'label' => array('title' => $lng['panel']['theme'], 'description' => $lng['serversettings']['default_theme']), 'settinggroup' => 'panel', 'varname' => 'default_theme', 'type' => 'option', @@ -42,6 +42,22 @@ return array( 'option_options_method' => 'getThemes', 'save_method' => 'storeSettingField', ), + 'panel_allow_theme_change_customer' => array( + 'label' => $lng['serversettings']['panel_allow_theme_change_customer'], + 'settinggroup' => 'panel', + 'varname' => 'allow_theme_change_customer', + 'type' => 'bool', + 'default' => true, + 'save_method' => 'storeSettingField', + ), + 'panel_allow_theme_change_admin' => array( + 'label' => $lng['serversettings']['panel_allow_theme_change_admin'], + 'settinggroup' => 'panel', + 'varname' => 'allow_theme_change_admin', + 'type' => 'bool', + 'default' => true, + 'save_method' => 'storeSettingField' + ), 'panel_natsorting' => array( 'label' => $lng['serversettings']['natsorting'], 'settinggroup' => 'panel', diff --git a/install/froxlor.sql b/install/froxlor.sql index 4c947455..e3b8f7d7 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -536,7 +536,9 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'use_webfonts', '0'), ('panel', 'webfont', 'Numans'), ('panel', 'phpconfigs_hidestdsubdomain', '0'), - ('panel', 'version', '0.9.29-dev1'); + ('panel', 'allow_theme_change_admin', '1'), + ('panel', 'allow_theme_change_customer', '1'), + ('panel', 'version', '0.9.29-dev2'); 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 2f61e9be..ef365350 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2053,7 +2053,7 @@ if (isFroxlorVersion('0.9.28')) { updateToVersion('0.9.28.1'); } -if(isFroxlorVersion('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); @@ -2072,4 +2072,18 @@ if(isFroxlorVersion('0.9.28.1')) { $db->query("UPDATE TABLE `panel_settings` SET `value`='".$db->escape($fastcgiparams)."' WHERE `varname`='fastcgiparams';"); } updateToVersion('0.9.29-dev1'); -} \ No newline at end of file +} + +if (isFroxlorVersion('0.9.29-dev1')) { + showUpdateStep("Updating from 0.9.29-dev1 to 0.9.29-dev2", true); + lastStepStatus(0); + + $allow_themechange_c = isset($_POST['allow_themechange_c']) ? (int)$_POST['allow_themechange_c'] : '1'; + $allow_themechange_a = isset($_POST['allow_themechange_a']) ? (int)$_POST['allow_themechange_a'] : '1'; + showUpdateStep("Inserting new setting to allow/disallow theme changes (default: on)", true); + $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_theme_change_admin', '".$allow_themechange_a."');"); + $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_theme_change_customer', '".$allow_themechange_c."');"); + lastStepStatus(0); + + updateToVersion('0.9.29-dev2'); +} 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 0aff35a4..09a5b319 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -516,4 +516,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } } + + if (versionInUpdate($current_version, '0.9.29-dev2')) { + $has_preconfig = true; + $description = 'You can now decide whether admins/customers are able to change the theme
'; + $question = 'If you want to disallow theme-changing, uncheck the checkboxes below: '; + $question.= "Admins: ". makeyesno('allow_themechange_a', '1', '0', '1'); + $question.= "Customers: ".makeyesno('allow_themechange_c', '1', '0', '1'); + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } } diff --git a/lib/navigation/00.froxlor.main.php b/lib/navigation/00.froxlor.main.php index 44101cd0..1f1c1c6d 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -37,6 +37,7 @@ return array ( array ( 'url' => 'customer_index.php?page=change_theme', 'label' => $lng['menue']['main']['changetheme'], + 'show_element' => (getSetting('panel', 'allow_theme_change_customer') == true) ), array ( 'url' => 'customer_index.php?action=logout', @@ -166,6 +167,7 @@ return array ( array ( 'url' => 'admin_index.php?page=change_theme', 'label' => $lng['menue']['main']['changetheme'], + 'show_element' => (getSetting('panel', 'allow_theme_change_admin') == true) ), array ( 'url' => 'admin_index.php?action=logout', diff --git a/lib/tables.inc.php b/lib/tables.inc.php index f04f9d53..99bcfe95 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -73,6 +73,6 @@ define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.29-dev1'; +$version = '0.9.29-dev2'; $dbversion = '2'; $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index 3aec455c..f815378b 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1938,3 +1938,7 @@ $lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['title'] = 'Hide sta $lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['description'] = 'If activated the standard-subdomains for customers will not be displayed in the php-configurations overview

Note: This is only visible if you have enabled FCGID or PHP-FPM'; $lng['serversettings']['passwordcryptfunc']['title'] = 'Chose which password-crypt method is to be used'; $lng['serversettings']['systemdefault'] = 'System default'; + +// Added in Froxlor 0.9.29-dev2 +$lng['serversettings']['panel_allow_theme_change_admin'] = 'Allow admins to change the theme'; +$lng['serversettings']['panel_allow_theme_change_customer'] = 'Allow customers to change the theme'; diff --git a/lng/german.lng.php b/lng/german.lng.php index c51c552a..c00c916e 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1659,3 +1659,7 @@ $lng['serversettings']['panel_phpconfigs_hidestdsubdomain']['title'] = 'Versteck $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.'; $lng['serversettings']['passwordcryptfunc']['title'] = 'Wähle zu verwendende Passwort-Verschlüsselungsmethode'; $lng['serversettings']['systemdefault'] = 'Systemstandard'; + +// Added in Froxlor 0.9.29-dev2 +$lng['serversettings']['panel_allow_theme_change_admin'] = 'Erlaube Admins das Theme zu wechseln'; +$lng['serversettings']['panel_allow_theme_change_customer'] = 'Erlaube Kunden das Theme zu wechseln';