diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-10-11 22:20:56 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-10-11 22:20:56 +0200 |
commit | f3a2a6151cc1161fe39ae5bd23c63728100c087b (patch) | |
tree | 3c1a35d2aaf24ea443021099f13e1e1b2874c0b5 | |
parent | 05cddf373d098c9550bd6ac430689ffd2f15748c (diff) | |
download | manatools-f3a2a6151cc1161fe39ae5bd23c63728100c087b.tar manatools-f3a2a6151cc1161fe39ae5bd23c63728100c087b.tar.gz manatools-f3a2a6151cc1161fe39ae5bd23c63728100c087b.tar.bz2 manatools-f3a2a6151cc1161fe39ae5bd23c63728100c087b.tar.xz manatools-f3a2a6151cc1161fe39ae5bd23c63728100c087b.zip |
added shadow last changes to Shared getUserInfo and update GUI
accordingly
-rw-r--r-- | lib/AdminPanel/Module/Users.pm | 5 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Users.pm | 54 |
2 files changed, 31 insertions, 28 deletions
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm index 78c242d1..b493e09f 100644 --- a/lib/AdminPanel/Module/Users.pm +++ b/lib/AdminPanel/Module/Users.pm @@ -1639,8 +1639,9 @@ sub _userPasswordInfoTabWidget { my $layout = $factory->createVBox($replace_pnt); my %userPasswordWidget; - my $userEnt = $self->sh_users->ctx->LookupUserByName($userData->{username}); - my $lastchg = $userEnt->ShadowLastChange($self->sh_users->USER_GetValue); + + my $userInfo = $self->sh_users->getUserInfo($userData->{username}); + my $lastchg = $userInfo->{last_change}; my $align = $factory->createLeft($layout); my $hbox = $factory->createHBox($align); diff --git a/lib/AdminPanel/Shared/Users.pm b/lib/AdminPanel/Shared/Users.pm index 58b1a418..ea2d0fdb 100644 --- a/lib/AdminPanel/Shared/Users.pm +++ b/lib/AdminPanel/Shared/Users.pm @@ -784,18 +784,19 @@ sub getGroupsInfo { =head3 OUTPUT $userInfo: HASH reference containing - uid => user identifier - gid => group identifier - fullname => user full name - home => home directory - shell => user shell - expire => shadow expire time - locked => is locked? - exp_min => shadow Min - exp_max => shadow Max - exp_warn => shadow Warn - exp_inact=> shadow Inact - members => groups the user belongs to + uid => user identifier + gid => group identifier + fullname => user full name + home => home directory + shell => user shell + expire => shadow expire time + locked => is locked? + exp_min => shadow Min + exp_max => shadow Max + exp_warn => shadow Warn + exp_inact => shadow Inact + last_change => Shadow last change + members => groups the user belongs to =head3 DESCRIPTION @@ -813,21 +814,22 @@ sub getUserInfo { my $userEnt = $self->ctx->LookupUserByName($username); return $userInfo if !defined($userEnt); - my $fullname = $userEnt->Gecos($self->USER_GetValue); + my $fullname = $userEnt->Gecos($self->USER_GetValue); utf8::decode($fullname); - $userInfo->{fullname} = $fullname; - $userInfo->{shell} = $userEnt->LoginShell($self->USER_GetValue); - $userInfo->{home} = $userEnt->HomeDir($self->USER_GetValue); - $userInfo->{uid} = $userEnt->Uid($self->USER_GetValue); - $userInfo->{gid} = $userEnt->Gid($self->USER_GetValue); - $userInfo->{expire} = $userEnt->ShadowExpire($self->USER_GetValue); - $userInfo->{locked} = $self->ctx->IsLocked($userEnt); - - $userInfo->{exp_min} = $userEnt->ShadowMin($self->USER_GetValue); - $userInfo->{exp_max} = $userEnt->ShadowMax($self->USER_GetValue); - $userInfo->{exp_warn} = $userEnt->ShadowWarn($self->USER_GetValue); - $userInfo->{exp_inact} = $userEnt->ShadowInact($self->USER_GetValue); - $userInfo->{members} = $self->ctx->EnumerateGroupsByUser($username); + $userInfo->{fullname} = $fullname; + $userInfo->{shell} = $userEnt->LoginShell($self->USER_GetValue); + $userInfo->{home} = $userEnt->HomeDir($self->USER_GetValue); + $userInfo->{uid} = $userEnt->Uid($self->USER_GetValue); + $userInfo->{gid} = $userEnt->Gid($self->USER_GetValue); + $userInfo->{expire} = $userEnt->ShadowExpire($self->USER_GetValue); + $userInfo->{locked} = $self->ctx->IsLocked($userEnt); + + $userInfo->{exp_min} = $userEnt->ShadowMin($self->USER_GetValue); + $userInfo->{exp_max} = $userEnt->ShadowMax($self->USER_GetValue); + $userInfo->{exp_warn} = $userEnt->ShadowWarn($self->USER_GetValue); + $userInfo->{exp_inact} = $userEnt->ShadowInact($self->USER_GetValue); + $userInfo->{last_change} = $userEnt->ShadowLastChange($self->USER_GetValue); + $userInfo->{members} = $self->ctx->EnumerateGroupsByUser($username); return $userInfo; } |