Separate pages for active and inactive accounts
This commit is contained in:
parent
b0c534cbfb
commit
37ffff48c5
|
@ -51,10 +51,6 @@
|
|||
<base>LABEL_WARN_USERS</base>
|
||||
<trans>Notify users</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>DESC_MODIFY_USER_PAGE</base>
|
||||
<trans>You can set the expiration of user account.</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>DESC_LOCK_ON_DATE</base>
|
||||
<trans>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.</trans>
|
||||
|
@ -119,18 +115,6 @@
|
|||
<base>DAYS_BEFORE_DELETE</base>
|
||||
<trans>Days left until deletion</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>USER_NOT_FOUND</base>
|
||||
<trans>The account couldn't be found in the database</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>ERROR_OCCURRED</base>
|
||||
<trans>An error occurred</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>USER_LOCKED</base>
|
||||
<trans>This account is already locked</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>TAINTED_USER</base>
|
||||
<trans>Invalid characters in the account name</trans>
|
||||
|
|
|
@ -51,10 +51,6 @@
|
|||
<base>LABEL_WARN_USERS</base>
|
||||
<trans>Notifier les utilisateurs</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>DESC_MODIFY_USER_PAGE</base>
|
||||
<trans>Vous pouvez configurer l'expiration du compte utilisateur.</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>DESC_LOCK_ON_DATE</base>
|
||||
<trans>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.</trans>
|
||||
|
@ -119,18 +115,6 @@
|
|||
<base>DAYS_BEFORE_DELETE</base>
|
||||
<trans>Jours restants avant suppression</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>USER_NOT_FOUND</base>
|
||||
<trans>Le compte n'a pas été trouvé dans la base</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>ERROR_OCCURRED</base>
|
||||
<trans>Une erreur est survenue</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>USER_LOCKED</base>
|
||||
<trans>Ce compte utilisateur est déjà verrouillé</trans>
|
||||
</entry>
|
||||
<entry>
|
||||
<base>TAINTED_USER</base>
|
||||
<trans>Caractères invalides dans le nom du compte</trans>
|
||||
|
|
|
@ -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__
|
|||
</field>
|
||||
<subroutine src="print_save_button()" />
|
||||
</page>
|
||||
<page name="Modify" pre-event="turn_off_buttons()" post-event="modify_user()">
|
||||
<description>DESC_MODIFY_USER_PAGE</description>
|
||||
<field
|
||||
type="literal"
|
||||
id="UserLockedWarning"
|
||||
value="print_user_locked_warning()">
|
||||
<page name="ModifyLocked" pre-event="turn_off_buttons()" post-event="modify_user()">
|
||||
<field type="select" id="ExpireAutoReply" value="get_user_bool('ExpireAutoReply')" options="'enabled' => 'ENABLED', 'disabled' => 'DISABLED'">
|
||||
<description>DESC_AUTO_REPLY</description>
|
||||
<label>LABEL_AUTO_REPLY</label>
|
||||
</field>
|
||||
<field type="select"
|
||||
id="ExpireDeleteAfterLock"
|
||||
value="get_user_prop('ExpireDeleteAfterLock')"
|
||||
options="'never', '7', '30', '180', '365'">
|
||||
<description>DESC_DELETE_AFTER_LOCK</description>
|
||||
<label>LABEL_DELETE_AFTER_LOCK</label>
|
||||
</field>
|
||||
<subroutine src="print_save_button()" />
|
||||
</page>
|
||||
<page name="ModifyActive" pre-event="turn_off_buttons()" post-event="modify_user()">
|
||||
<field type="text" size="30" id="ExpireLockOn" validation="is_future_date_or_empty" value="get_user_prop('ExpireLockOn')">
|
||||
<description>DESC_LOCK_ON_DATE</description>
|
||||
<label>LABEL_LOCK_ON_DATE</label>
|
||||
|
|
|
@ -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 = "<a href=\"$scriptname?page=0&page_stack=&acctName=$username&wherenext=Modify\">" .
|
||||
my $action = "<a href=\"$scriptname?page=0&page_stack=&acctName=$username&wherenext=ModifyActive\">" .
|
||||
$self->localise('MODIFY') . "</a>";
|
||||
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 = "<a href=\"$scriptname?page=0&page_stack=&acctName=$username&wherenext=Modify\">" .
|
||||
my $action = "<a href=\"$scriptname?page=0&page_stack=&acctName=$username&wherenext=ModifyLocked\">" .
|
||||
$self->localise('MODIFY') . "</a>";
|
||||
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");
|
||||
|
|
Loading…
Reference in New Issue