%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.35 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/usr/share/webmin/ |
Upload File : |
#!/usr/bin/perl
# switch_theme.cgi
# Change the theme for the current user if allowed
BEGIN { push(@INC, "."); };
use WebminCore;
&init_config();
&ReadParse();
&PrintHeader();
my $err = sub {
print("<tt>Cannot change theme : $_[0]</tt>\n");
exit(1);
};
# Check if allowed to change theme,
# otherwise throw an error
if (!&foreign_available('theme') &&
!&foreign_available('change-user') &&
!&foreign_available('webmin') &&
!&foreign_available('acl')) {
&$err("You are not allowed to change themes!");
}
# Check if the theme is known
&$err("Theme identification is not known!")
if (!$in{'theme'} || $in{'theme'} !~ /^[123]$/);
# Check if the remote user is known
&$err("Remote user is not known!") if (!$remote_user);
# Define the theme
my $themes = {
'1' => 'authentic-theme',
'2' => 'gray-theme',
'3' => '' };
my $theme = $themes->{$in{'theme'}};
# Change the theme
&foreign_require('acl');
my @users = &acl::list_users();
my ($user) = grep { $_->{'name'} eq $remote_user } @users;
$user->{'theme'} = $theme;
&acl::modify_user($user->{'name'}, $user);
&load_theme_library();
&theme_post_change_theme() if (defined(&theme_post_change_theme));
&reload_miniserv();
print &js_redirect("/", "top");