diff options
-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; } |