From d903606d88748fc3beddd0edca8b05c41456ad47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Fri, 4 Nov 2011 10:43:36 +0000 Subject: [PATCH] Display confirmation link expiration date in mail reset template (#378) --- modules/lemonldap-ng-portal/example/mail.pl | 14 ++++++++++++++ .../example/skins/impact/mail.tpl | 8 ++++++++ .../example/skins/pastel/mail.tpl | 12 ++++++++++++ .../lib/Lemonldap/NG/Portal/MailReset.pm | 9 +++++---- 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/modules/lemonldap-ng-portal/example/mail.pl b/modules/lemonldap-ng-portal/example/mail.pl index ec8871300..3ae89e854 100755 --- a/modules/lemonldap-ng-portal/example/mail.pl +++ b/modules/lemonldap-ng-portal/example/mail.pl @@ -28,6 +28,8 @@ $template->param( AUTH_ERROR => $portal->error ); $template->param( AUTH_ERROR_TYPE => $portal->error_type ); $template->param( CHOICE_PARAM => $portal->{authChoiceParam} ); $template->param( CHOICE_VALUE => $portal->{_authChoice} ); +$template->param( EXPMAILDATE => $portal->{expMailDate} ); +$template->param( EXPMAILTIME => $portal->{expMailTime} ); $template->param( MAIL => $portal->checkXSSAttack( 'mail', $portal->{mail} ) ? "" @@ -52,6 +54,7 @@ if ( $template->param( DISPLAY_FORM => 1 ); $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_MAILSENT => 0 ); $template->param( DISPLAY_PASSWORD_FORM => 0 ); } @@ -59,14 +62,25 @@ if ( if ( $portal->{error} == PE_MAILCONFIRMATION_ALREADY_SENT ) { $template->param( DISPLAY_FORM => 0 ); $template->param( DISPLAY_RESEND_FORM => 1 ); + $template->param( DISPLAY_MAILSENT => 0 ); $template->param( DISPLAY_PASSWORD_FORM => 0 ); } +# Display mail sent +if ( $portal->{error} == PE_MAILOK ) { + $template->param( DISPLAY_FORM => 0 ); + $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_MAILSENT => 1 ); + $template->param( DISPLAY_PASSWORD_FORM => 0 ); +} + +# Display password change form if ( $portal->{mail_token} and ( $portal->{error} != PE_MAILERROR and $portal->{error} != PE_MAILOK ) ) { $template->param( DISPLAY_FORM => 0 ); $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_MAILSENT => 0 ); $template->param( DISPLAY_PASSWORD_FORM => 1 ); } diff --git a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl index ac0bdffc0..233045ba8 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl @@ -84,6 +84,14 @@ + +
+ + + . +
+
+
+ + + +