add possibility to allow/disallow changing of themes; fixes #1175
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
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") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user