From f13a3e0cfec330329c69d06b475525550398ac0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Fri, 4 Nov 2011 11:09:08 +0000 Subject: [PATCH] Add a parameter to know if the mail was already sent in mail reset screens (#378) --- modules/lemonldap-ng-portal/example/mail.pl | 1 + .../lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/lemonldap-ng-portal/example/mail.pl b/modules/lemonldap-ng-portal/example/mail.pl index 3ae89e854..0e2f482a5 100755 --- a/modules/lemonldap-ng-portal/example/mail.pl +++ b/modules/lemonldap-ng-portal/example/mail.pl @@ -30,6 +30,7 @@ $template->param( CHOICE_PARAM => $portal->{authChoiceParam} ); $template->param( CHOICE_VALUE => $portal->{_authChoice} ); $template->param( EXPMAILDATE => $portal->{expMailDate} ); $template->param( EXPMAILTIME => $portal->{expMailTime} ); +$template->param( MAILALREADYSENT => $portal->{mail_already_sent} ); $template->param( MAIL => $portal->checkXSSAttack( 'mail', $portal->{mail} ) ? "" diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm index 61e0fe3e5..a203756d8 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm @@ -191,10 +191,10 @@ sub sendConfirmationMail { # Check if confirmation mail has already been sent my $mail_session = $self->getMailSession( $self->{mail} ); - my $mail_already_sent = ( $mail_session and !$self->{id} ) ? 1 : 0; + $self->{mail_already_sent} = ( $mail_session and !$self->{id} ) ? 1 : 0; # Ask if user want another confirmation email - if ( $mail_already_sent and !$self->param('resendconfirmation') ) { + if ( $self->{mail_already_sent} and !$self->param('resendconfirmation') ) { return PE_MAILCONFIRMATION_ALREADY_SENT; } else {