X7ROOT File Manager
Current Path:
/usr/libexec/webmin/cluster-passwd
usr
/
libexec
/
webmin
/
cluster-passwd
/
📁
..
📄
CHANGELOG
(128 B)
📄
acl_security.pl
(3.62 KB)
📄
change-passwd.pl
(1.84 KB)
📄
cluster-passwd-lib.pl
(4.09 KB)
📄
config
(39 B)
📄
config.info
(160 B)
📄
config.info.ca
(190 B)
📄
config.info.cs
(206 B)
📄
config.info.de
(163 B)
📄
config.info.el
(311 B)
📄
config.info.es
(208 B)
📄
config.info.fr
(220 B)
📄
config.info.hr
(0 B)
📄
config.info.hu
(0 B)
📄
config.info.ms
(187 B)
📄
config.info.nl
(181 B)
📄
config.info.no
(174 B)
📄
config.info.pl
(214 B)
📄
defaultacl
(64 B)
📄
edit_passwd.cgi
(1.44 KB)
📁
images
📄
index.cgi
(1.5 KB)
📁
lang
📄
log_parser.pl
(447 B)
📄
module.info
(205 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(118 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(170 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(178 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(193 B)
📄
module.info.ca
(127 B)
📄
module.info.cs
(31 B)
📄
module.info.cs.auto
(77 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(116 B)
📄
module.info.de
(102 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(230 B)
📄
module.info.es
(41 B)
📄
module.info.es.auto
(90 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(123 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(193 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(109 B)
📄
module.info.fr
(50 B)
📄
module.info.fr.auto
(95 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(142 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(113 B)
📄
module.info.hu
(40 B)
📄
module.info.hu.auto
(75 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(135 B)
📄
module.info.ja
(0 B)
📄
module.info.ja.auto
(151 B)
📄
module.info.ko
(0 B)
📄
module.info.ko.auto
(146 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(132 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(107 B)
📄
module.info.ms
(118 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(117 B)
📄
module.info.nl
(38 B)
📄
module.info.nl.auto
(91 B)
📄
module.info.no
(31 B)
📄
module.info.no.auto
(74 B)
📄
module.info.pl
(112 B)
📄
module.info.pt
(0 B)
📄
module.info.pt.auto
(124 B)
📄
module.info.pt_BR
(0 B)
📄
module.info.pt_BR.auto
(130 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(122 B)
📄
module.info.ru
(0 B)
📄
module.info.ru.auto
(171 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(111 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(104 B)
📄
module.info.sv
(0 B)
📄
module.info.sv.auto
(114 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(257 B)
📄
module.info.tr
(0 B)
📄
module.info.tr.auto
(130 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(183 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(171 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(140 B)
📄
module.info.zh
(0 B)
📄
module.info.zh.auto
(94 B)
📄
module.info.zh_TW
(0 B)
📄
module.info.zh_TW.auto
(100 B)
📄
prefs.info
(38 B)
📄
save_passwd.cgi
(1.65 KB)
Editing: cluster-passwd-lib.pl
# cluster-passwd-lib.pl BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); %access = &get_module_acl(); &foreign_require("cluster-useradmin", "cluster-useradmin-lib.pl"); &foreign_require("passwd", "passwd-lib.pl"); &foreign_require("useradmin", "user-lib.pl"); # get_all_users([&hosts]) sub get_all_users { local @hosts = $_[0] ? @{$_[0]} : &cluster_useradmin::list_useradmin_hosts(); local ($h, %done, @ulist); foreach $h (sort { $a->{'id'} <=> $b->{'id'} } @hosts) { foreach $u (@{$h->{'users'}}) { $u->{'host'} = $h; push(@ulist, $u) if (!$done{$u->{'user'}}++); } } return @ulist; } # can_edit_passwd(&user) sub can_edit_passwd { if ($access{'mode'} == 0) { return 1; } elsif ($access{'mode'} == 3) { return $_[0]->{'user'} eq $remote_user; } elsif ($access{'mode'} == 4) { return (!$access{'low'} || $_[0]->{'uid'} >= $access{'low'}) && (!$access{'high'} || $_[0]->{'uid'} <= $access{'high'}); } elsif ($access{'mode'} == 5) { local ($g) = grep { $_->{'gid'} == $_[0]->{'gid'} } @{$_[0]->{'host'}->{'groups'}}; return 1 if (&indexof($g->{'group'}, split(/\s+/, $access{'users'})) >= 0); if ($access{'sec'}) { local $gname; foreach $gname (split(/\s+/, $access{'users'})) { local ($g) = grep { $_->{'group'} eq $gname } @{$_[0]->{'host'}->{'groups'}}; return 1 if (&indexof($_[0]->{'user'}, split(/,/, $g->{'members'})) >= 0); } } return 0; } elsif ($access{'mode'} == 6) { return $_[0]->{'user'} =~ /$access{'users'}/; } else { local $idx = &indexof($_[0]->{'user'}, split(/\s+/, $access{'users'})); return $access{'mode'} == 1 && $idx >= 0 || $access{'mode'} == 2 && $idx < 0; } } sub passwd_error { $passwd_error_msg = join("", @_); } # modify_on_hosts(&hosts, username, newpass, others, &printfunc) # Updates the user on all hosts that he exists sub modify_on_hosts { &remote_error_setup(\&passwd_error); local $pfunc = $_[4]; local @servers = &cluster_useradmin::list_servers(); local $host; foreach $host (@{$_[0]}) { # Connect to the host and get the user $passwd_error_msg = undef; local $user = grep { $_->{'user'} eq $_[1] } @{$host->{'users'}}; next if (!$user); local ($serv) = grep { $_->{'id'} == $host->{'id'} } @servers; &$pfunc(-1, &text('passwd_on', $serv->{'desc'} || $serv->{'host'})); &remote_foreign_require($serv->{'host'}, "useradmin", "user-lib.pl"); if ($passwd_error_msg) { # Host is down .. &$pfunc(1, &cluster_useradmin::text( 'usave_failed', $passwd_error_msg)); next; } local @ulist = &remote_foreign_call($serv->{'host'}, "useradmin", "list_users"); ($user) = grep { $_->{'user'} eq $_[1] } @ulist; if (!$user) { # No longer exists? &$pfunc(2, $cluster_useradmin::text{'usave_gone'}); next; } # Update password fields in user $user->{'olduser'} = $user->{'user'}; $user->{'pass'} = &remote_foreign_call($serv->{'host'}, "useradmin", "encrypt_password", $_[2]); $user->{'passmode'} = 3; $user->{'plainpass'} = $_[2]; local $pft = &useradmin::passfiles_type(); if ($pft == 2 || $pft == 5) { $user->{'change'} = int(time() / (60*60*24)); } elsif ($pft == 4) { $user->{'change'} = time(); } # Run the pre-change command &remote_eval($serv->{'host'}, "useradmin", "set_user_envs", $user); &remote_foreign_call($serv->{'host'}, "useradmin", "making_changes"); # Update the user on the server &$pfunc(-2, $cluster_useradmin::text{'usave_update'}); &remote_foreign_call($serv->{'host'}, "useradmin", "modify_user", $user, $user); &$pfunc(-3, $cluster_useradmin::text{'udel_done'}); # Run post-change command &remote_foreign_call($serv->{'host'}, "useradmin", "made_changes"); if ($_[3]) { # Update the user in other modules &$pfunc(-2, $cluster_useradmin::text{'usave_mothers'}); $user->{'passmode'} = 3; $user->{'plainpass'} = $_[2]; &remote_foreign_call($serv->{'host'}, "useradmin", "other_modules", "useradmin_modify_user", $user, $user); &$pfunc(-3, $cluster_useradmin::text{'udel_done'}); } # Update in local list $host->{'users'} = \@ulist; &cluster_useradmin::save_useradmin_host($host); &$pfunc(-4); } } 1;
Upload File
Create Folder