%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,mail,shell_exec,system,proc_open,popen,ini_alter,dl,proc_close,curl_exec,curl_multi_exec,readfile,parse_ini_file,escapeshellarg,escapeshellcmd,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,mail,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/acl/ |
Upload File : |
use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; if (!$main::done_foreign_require{"acl","acl-lib.pl"}) { do "acl-lib.pl"; } our (%config, $config_directory); # useradmin_create_user(&details) # Create a new webmin user in the group sub useradmin_create_user { my ($unix) = @_; return if (!$config{'sync_create'}); my $group = &get_group($config{'sync_group'}); return if (!$group); my $clash = &get_user($unix->{'user'}) || &get_group($unix->{'user'}); return if ($clash); return if ($unix->{'user'} !~ /^[A-z0-9\-\_\.]+$/); my $user = { 'name' => $unix->{'user'}, 'pass' => $config{'sync_unix'} ? 'x' : $unix->{'pass'}, 'sync' => 1, 'modules' => $group->{'modules'} }; &create_user($user); push(@{$group->{'members'}}, $user->{'name'}); &modify_group($group->{'name'}, $group); foreach my $m (@{$group->{'modules'}}, "") { my %groupacl; unlink("$config_directory/$m/$user->{'name'}.acl"); if (&read_file("$config_directory/$m/$group->{'name'}.gacl", \%groupacl)) { &write_file("$config_directory/$m/$user->{'name'}.acl", \%groupacl); } } &reload_miniserv(); } # useradmin_delete_user(&details) # Delete this webmin user if in sync sub useradmin_delete_user { my ($unix) = @_; return if (!$config{'sync_delete'}); my $u = &get_user($unix->{'user'}); if ($u) { &delete_user($u->{'name'}); &reload_miniserv(); } foreach my $g (&list_groups()) { next if (!$g->{'members'}); my @mems = @{$g->{'members'}}; my $i = &indexof($_[0]->{'user'}, @mems); if ($i >= 0) { splice(@mems, $i, 1); $g->{'members'} = \@mems; &modify_group($g->{'name'}, $g); } } } # useradmin_modify_user(&details) # Update this users password if in sync sub useradmin_modify_user { my ($unix) = @_; return if ($unix->{'passmode'} == 4 && $unix->{'olduser'} eq $unix->{'user'}); my $u = &get_user($unix->{'olduser'}); if ($u && ($u->{'sync'} || $config{'sync_modify'})) { if ($unix->{'user'} ne $unix->{'olduser'}) { # User has been renamed .. but name might clash or be invalid my $clash = &get_user($unix->{'user'}) || &get_group($unix->{'user'}); return if ($clash); return if ($unix->{'user'} !~ /^[A-z0-9\-\_\.]+$/); } $u->{'name'} = $unix->{'user'}; if ($u->{'pass'} ne 'x' && $u->{'sync'}) { # Password has been updated $u->{'pass'} = $unix->{'passmode'} == 3 ? &encrypt_password($unix->{'plainpass'}) : $unix->{'pass'}; } &modify_user($unix->{'olduser'}, $u); &reload_miniserv(); } if ($unix->{'olduser'} && $unix->{'user'} ne $unix->{'olduser'}) { # Check other users' acl module acls foreach my $u (&list_users()) { my %uaccess = &get_module_acl($u->{'name'}); my @au = split(/\s+/, $uaccess{'users'}); my $idx = &indexof($unix->{'olduser'}, @au); if ($idx != -1) { $au[$idx] = $unix->{'user'}; $uaccess{'users'} = join(" ", @au); &save_module_acl(\%uaccess, $u->{'name'}); } } # Rename the user in his group foreach my $g (&list_groups()) { my @mems = @{$g->{'members'}}; my $i = &indexof($unix->{'olduser'}, @mems); if ($i >= 0) { $mems[$i] = $unix->{'user'}; $g->{'members'} = \@mems; &modify_group($g->{'name'}, $g); } } } } 1;