diff options
author | Daouda Lo <daouda@mandriva.com> | 2003-06-19 07:45:22 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2003-06-19 07:45:22 +0000 |
commit | b6ce32b4f4f5e4908a3084a38fd42456116940f2 (patch) | |
tree | e9a4acb89d00cb18172cf5469c8d1e18145db389 | |
parent | bf59487d84f07a6f61bfdb37fccc7cf0df4f5d24 (diff) | |
download | userdrake-b6ce32b4f4f5e4908a3084a38fd42456116940f2.tar userdrake-b6ce32b4f4f5e4908a3084a38fd42456116940f2.tar.gz userdrake-b6ce32b4f4f5e4908a3084a38fd42456116940f2.tar.bz2 userdrake-b6ce32b4f4f5e4908a3084a38fd42456116940f2.tar.xz userdrake-b6ce32b4f4f5e4908a3084a38fd42456116940f2.zip |
- Locking implementation
-rwxr-xr-x | userdrake2 | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -464,7 +464,7 @@ sub Edit { my $w = ugtk2->new('userdrake', grab => 1); my $model = Gtk2::ListStore->new(Gtk2::GType->OBJECT, Gtk2::GType->STRING, Gtk2::GType->INT); my $tree = Gtk2::TreeView->new_with_model($model); my %g; my %u; - my ($groupname, $username, $groupEnt, $userEnt, $members, $times); + my ($groupname, $username, $groupEnt, $userEnt, $members, $times, $min, $max, $warn, $inact); my @primgroup; my @pix = ($pixdir.'selected.png', $pixdir.'unselected.png'); $tree->get_selection->set_mode('browse'); @@ -527,8 +527,7 @@ sub Edit { my $Uid = $userEnt->Uid($GetValue); my $expire = $userEnt->ShadowExpire($GetValue); if ($expire && $expire != -1) { - $us->{o}->{acheckexpire}->set_active(1); - $h->set_sensitive(1); + $us->{o}->{acheckexpire}->set_active(1); $h->set_sensitive(1); $times = TimeOfArray($expire); $us->{o}->{expd}->set_text($times->{dayint}); $us->{o}->{expm}->set_text($times->{month}); $us->{o}->{expy}->set_text($times->{year}) @@ -536,9 +535,15 @@ sub Edit { #root account should never be locked !$Uid and $us->{o}->{lockuser}->set_sensitive(0); my $lastchg = $userEnt->ShadowLastChange($GetValue); - if ($lastchg) { $times = TimeOfArray($lastchg); + if ($lastchg) { $times = TimeOfArray($lastchg); $dayStr->set_text($times->{daystr}); $month->set_text($times->{month}); $dayInt->set_text($times->{dayint}); $year->set_text($times->{year}) ; } + $min = $userEnt->ShadowMin($GetValue); $max =$userEnt->ShadowMax($GetValue); $warn = $userEnt->ShadowWarn($GetValue); $inact = $userEnt->ShadowInact($GetValue); + if ($min && $min != -1 || $max && $max != -1 || $warn && $warn != -1 || $inact && $inact != -1) { + $us->{o}->{pcheckexpire}->set_active(1); $v->set_sensitive(1); + } + $min && $min != -1 and $us->{o}->{dbca}->set_text($min); $max && $max != -1 and $us->{o}->{dbcr}->set_text($max); + $warn && $warn != -1 and $us->{o}->{bwbc}->set_text($warn); $inact && $inact != -1 and $us->{o}->{dbai}->set_text($inact); my $grps = $ctx->GroupsEnumerate(); my @sgroups = sort(@$grps); $members = $ctx->EnumerateGroupsByUser($username); my $primgid = $userEnt->Gid($GetValue); @@ -659,7 +664,7 @@ sub Edit { sub TimeOfArray { my $reltime = shift; my $h; my $t; - $t = gmtime($reltime * 24 * 60 * 60) =~ /(\S+)\ (\S+)\ (\d+)\ (\S+)\ (\d+)/; + $t = gmtime($reltime * 24 * 60 * 60) =~ /(\S+)\s+(\S+)\s+(\d+)\s+(\S+)\s+(\d+)/; $h->{daystr} = $1; $h->{month} = $2; $h->{dayint} = $3; $h->{year} = $5 ; $h } |