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 {