From 37ffff48c528402b8743676f80004921339c67a2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 3 Feb 2016 17:18:01 +0100 Subject: [PATCH] Separate pages for active and inactive accounts --- .../en/etc/e-smith/web/functions/expireaccounts | 16 --------------- .../fr/etc/e-smith/web/functions/expireaccounts | 16 --------------- root/etc/e-smith/web/functions/expireaccounts | 23 ++++++++++++++-------- .../esmith/FormMagick/Panel/expireaccounts.pm | 17 ++-------------- 4 files changed, 17 insertions(+), 55 deletions(-) diff --git a/root/etc/e-smith/locale/en/etc/e-smith/web/functions/expireaccounts b/root/etc/e-smith/locale/en/etc/e-smith/web/functions/expireaccounts index 228d1fb..13b9589 100644 --- a/root/etc/e-smith/locale/en/etc/e-smith/web/functions/expireaccounts +++ b/root/etc/e-smith/locale/en/etc/e-smith/web/functions/expireaccounts @@ -52,10 +52,6 @@ Notify users - DESC_MODIFY_USER_PAGE - You can set the expiration of user account. - - DESC_LOCK_ON_DATE Specify the date on which the account will automatically be locked. The date must be in YYYY-MM-DD format, eg 2018-07-25 for July the 25th 2018. Keep this field blank to disable account expiration. @@ -120,18 +116,6 @@ Days left until deletion - USER_NOT_FOUND - The account couldn't be found in the database - - - ERROR_OCCURRED - An error occurred - - - USER_LOCKED - This account is already locked - - TAINTED_USER Invalid characters in the account name diff --git a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/expireaccounts b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/expireaccounts index 5bc20b3..4213b73 100644 --- a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/expireaccounts +++ b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/expireaccounts @@ -52,10 +52,6 @@ Notifier les utilisateurs - DESC_MODIFY_USER_PAGE - Vous pouvez configurer l'expiration du compte utilisateur. - - DESC_LOCK_ON_DATE Précisez ici la date à laquelle le compte sera automatiquement verrouillé. La date doit être au format AAAA-MM-JJ, par exemple 2018-07-25 pour le 25 Juillet 2018. Laissez ce champs vide pour désactiver l'expiration du compte. @@ -120,18 +116,6 @@ Jours restants avant suppression - USER_NOT_FOUND - Le compte n'a pas été trouvé dans la base - - - ERROR_OCCURRED - Une erreur est survenue - - - USER_LOCKED - Ce compte utilisateur est déjà verrouillé - - TAINTED_USER Caractères invalides dans le nom du compte diff --git a/root/etc/e-smith/web/functions/expireaccounts b/root/etc/e-smith/web/functions/expireaccounts index 77ca434..93f6974 100755 --- a/root/etc/e-smith/web/functions/expireaccounts +++ b/root/etc/e-smith/web/functions/expireaccounts @@ -3,7 +3,7 @@ # vim: ft=xml ts=4 sw=4 et: #---------------------------------------------------------------------- # heading : Collaboration -# description : User Informations +# description : Accounts Expiration # navigation : 2000 2100 #---------------------------------------------------------------------- #---------------------------------------------------------------------- @@ -29,7 +29,6 @@ #---------------------------------------------------------------------- use strict; -use esmith::TestUtils; use esmith::FormMagick::Panel::expireaccounts; my $fm = esmith::FormMagick::Panel::expireaccounts->new(); @@ -64,13 +63,21 @@ __DATA__ - - DESC_MODIFY_USER_PAGE - + + + DESC_AUTO_REPLY + + + + DESC_DELETE_AFTER_LOCK + + + + DESC_LOCK_ON_DATE diff --git a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm index 0b8b758..05fa881 100644 --- a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm +++ b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm @@ -38,7 +38,6 @@ our @EXPORT = qw( print_save_button print_custom_button print_section_bar - print_user_locked_warning ); our $a = esmith::AccountsDB->open || die "Couldn't open AccountsDB"; @@ -89,7 +88,7 @@ sub print_user_table { my $lock_date = $u->prop('ExpireLockOn') || ''; my $delivery = $u->prop('EmailForward') || 'local'; my $fwd = $u->prop('ForwardAddress') || ''; - my $action = "" . + my $action = "" . $self->localise('MODIFY') . ""; my $days_left = ''; if ($lock_date =~ m/^(\d{4})\-(\d{1,2})\-(\d{1,2})$/){ @@ -131,7 +130,7 @@ sub print_user_table { my $locked_on = $u->prop('ExpireLockedOn') || ''; my $delivery = $u->prop('EmailForward') || ''; my $fwd = $u->prop('ForwardAddress') || ''; - my $action = "" . + my $action = "" . $self->localise('MODIFY') . ""; my $days_left = ''; if ($delete_in =~ m/^\d+$/ && $locked_on =~ m/^(\d{4})\-(\d{1,2})\-(\d{1,2})$/){ @@ -163,18 +162,6 @@ sub print_user_table { return ""; } -sub print_user_locked_warning { - my ($self) = @_; - my $u = $self->{cgi}->param('acctName'); - my $user = $a->get($u); - return $self->localise('USER_NOT_FOUND') unless ($user); - my $type = $user->prop('type'); - return $self->localise('ERROR_OCCURRED') unless ($type && $type eq 'user'); - my $pass = $user->prop('PasswordSet') || 'no'; - return $self->localise('USER_LOCKED') if ($pass eq 'no'); - return ""; -} - sub print_save_button { my ($self) = @_; $self->print_button("SAVE");