add possibility to allow/disallow changing of themes; fixes #1175
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2073,3 +2073,17 @@ if(isFroxlorVersion('0.9.28.1')) {
|
||||
}
|
||||
updateToVersion('0.9.29-dev1');
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
@@ -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<br />';
|
||||
$question = '<strong>If you want to disallow theme-changing, uncheck the checkboxes below:</strong> ';
|
||||
$question.= "Admins: ". makeyesno('allow_themechange_a', '1', '0', '1');
|
||||
$question.= "Customers: ".makeyesno('allow_themechange_c', '1', '0', '1');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -73,6 +73,6 @@ define('PACKAGE_ENABLED', 2);
|
||||
|
||||
// VERSION INFO
|
||||
|
||||
$version = '0.9.29-dev1';
|
||||
$version = '0.9.29-dev2';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
|
||||
@@ -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<br /><br />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';
|
||||
|
||||
@@ -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.<br /><br />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';
|
||||
|
||||
Reference in New Issue
Block a user