mirror of
https://github.com/webmin/webmin.git
synced 2025-08-19 01:15:14 +00:00
Fix to only enable theme switcher in debug mode
This commit is contained in:
@ -12,6 +12,9 @@ my $err = sub {
|
||||
print("<tt>Cannot change theme : $_[0]</tt>\n");
|
||||
exit(1);
|
||||
};
|
||||
# Check if in debug mode
|
||||
&$err("Debug mode is not enabled!")
|
||||
if (!$gconfig{'error_stack'} && !$gconfig{'debug_enabled'});
|
||||
# Check if allowed to change theme,
|
||||
# otherwise throw an error
|
||||
if (!&foreign_available('theme') &&
|
||||
|
@ -2299,7 +2299,8 @@ Hotkeys are:
|
||||
sub ui_switch_theme_javascript
|
||||
{
|
||||
return &theme_ui_switch_theme_javascript(@_) if (defined(&theme_ui_switch_theme_javascript));
|
||||
my $switch_script = "<script>const __webmin_webprefix__ = '@{[&get_webprefix()]}';</script>";
|
||||
return "" if (!$gconfig{'error_stack'} && !$gconfig{'debug_enabled'});
|
||||
my $switch_script = "<script>const __webmin_webprefix__ = '@{[&get_webprefix()]}';</script>\n";
|
||||
$switch_script .= "<script type=\"text/javascript\" src=\"@{[&get_webprefix()]}/unauthenticated/switch_theme.js?@{[&get_webmin_version(1)]}\"></script>\n";
|
||||
return $switch_script;
|
||||
}
|
||||
|
Reference in New Issue
Block a user