diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-10-14 22:42:03 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-10-14 22:42:03 +0200 |
commit | e59223e7737d9d85fdbb155ad30c2172f81e9774 (patch) | |
tree | 94c2d49d49c6491ca8b7d680c05915d91e41ab5d /lib/AdminPanel | |
parent | b6132cc811fcd1968643c736c0a0f6346aec89ea (diff) | |
download | colin-keep-e59223e7737d9d85fdbb155ad30c2172f81e9774.tar colin-keep-e59223e7737d9d85fdbb155ad30c2172f81e9774.tar.gz colin-keep-e59223e7737d9d85fdbb155ad30c2172f81e9774.tar.bz2 colin-keep-e59223e7737d9d85fdbb155ad30c2172f81e9774.tar.xz colin-keep-e59223e7737d9d85fdbb155ad30c2172f81e9774.zip |
fixed user change name and expirirng time
Diffstat (limited to 'lib/AdminPanel')
-rw-r--r-- | lib/AdminPanel/Module/Users.pm | 13 | ||||
-rw-r--r-- | lib/AdminPanel/Shared/Users.pm | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm index 3c0a1b8..14d74cd 100644 --- a/lib/AdminPanel/Module/Users.pm +++ b/lib/AdminPanel/Module/Users.pm @@ -1281,7 +1281,8 @@ sub _getUserInfo { } my %userData; - $userData{username} = $item->label(); + $userData{old_username} = $item->label(); + $userData{username} = $item->label(); my $userInfo = $self->sh_users->getUserInfo($userData{username}); @@ -1873,7 +1874,6 @@ sub _userEdit_Ok { } my $userInfo = { -# old_username => $TDODO, username => $userData->{username}, fullname => $userData->{full_name}, homedir => $userData->{homedir}, @@ -1883,6 +1883,7 @@ sub _userEdit_Ok { lockuser => $userData->{lockuser}, }; + $userInfo->{old_username} = $userData->{old_username} if $userData->{username} ne $userData->{old_username}; $userInfo->{password} = $userData->{password} if $userData->{password} ne ''; @@ -2578,14 +2579,6 @@ sub _ValidInt { return 1; } -sub _ConvTime { - my ($day, $month, $year) = @_; - my ($tm, $days, $mon, $yr); - $mon = $month - 1; $yr = $year - 1900; - $tm = POSIX::mktime(0, 0, 0, $day, $mon, $yr); - $days = ceil($tm / (24 * 60 * 60)); - return $days; -} sub _TimeOfArray { my ($reltime, $cm) = @_; diff --git a/lib/AdminPanel/Shared/Users.pm b/lib/AdminPanel/Shared/Users.pm index 9407734..73322cd 100644 --- a/lib/AdminPanel/Shared/Users.pm +++ b/lib/AdminPanel/Shared/Users.pm @@ -1597,6 +1597,14 @@ sub Add2UsersGroup { return $usersgroup->Gid($self->USER_GetValue); } +sub _ConvTime { + my ($day, $month, $year) = @_; + my ($tm, $days, $mon, $yr); + $mon = $month - 1; $yr = $year - 1900; + $tm = POSIX::mktime(0, 0, 0, $day, $mon, $yr); + $days = ceil($tm / (24 * 60 * 60)); + return $days; +} no Moose; __PACKAGE__->meta->make_immutable; |