From f56dcedfa08c2774f95d5a5c38d7aed8b848e3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Fri, 4 Nov 2011 16:34:16 +0000 Subject: [PATCH] Dissociate confirm mail sent and norman mail sent error case in mail reset (#377) --- .../lib/Lemonldap/NG/Handler/Status.pm | 1 + modules/lemonldap-ng-portal/example/mail.pl | 45 ++++++++++++------- .../example/skins/impact/mail.tpl | 8 +++- .../example/skins/pastel/mail.tpl | 10 ++++- .../lib/Lemonldap/NG/Portal/MailReset.pm | 3 +- .../lib/Lemonldap/NG/Portal/Simple.pm | 4 +- .../lib/Lemonldap/NG/Portal/_i18n.pm | 4 ++ 7 files changed, 55 insertions(+), 20 deletions(-) diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm index 801cded0f..f695f79f9 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm @@ -89,6 +89,7 @@ sub portalTab { 69 => 'PORTAL_MAILFIRSTACCESS', 70 => 'PORTAL_MAILNOTFOUND', 71 => 'PORTAL_PASSWORDFIRSTACCESS', + 72 => 'PORTAL_MAILCONFIRMOK', }; } diff --git a/modules/lemonldap-ng-portal/example/mail.pl b/modules/lemonldap-ng-portal/example/mail.pl index 86299c9f7..0137d84b3 100755 --- a/modules/lemonldap-ng-portal/example/mail.pl +++ b/modules/lemonldap-ng-portal/example/mail.pl @@ -58,36 +58,49 @@ if ( ) { - $template->param( DISPLAY_FORM => 1 ); - $template->param( DISPLAY_RESEND_FORM => 0 ); - $template->param( DISPLAY_MAILSENT => 0 ); - $template->param( DISPLAY_PASSWORD_FORM => 0 ); + $template->param( DISPLAY_FORM => 1 ); + $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_CONFIRMMAILSENT => 0 ); + $template->param( DISPLAY_MAILSENT => 0 ); + $template->param( DISPLAY_PASSWORD_FORM => 0 ); } # Display mail confirmation resent form 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 ); + $template->param( DISPLAY_FORM => 0 ); + $template->param( DISPLAY_RESEND_FORM => 1 ); + $template->param( DISPLAY_CONFIRMMAILSENT => 0 ); + $template->param( DISPLAY_MAILSENT => 0 ); + $template->param( DISPLAY_PASSWORD_FORM => 0 ); +} + +# Display confirmation mail sent +if ( $portal->{error} == PE_MAILCONFIRMOK ) { + $template->param( DISPLAY_FORM => 0 ); + $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_CONFIRMMAILSENT => 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 ); + $template->param( DISPLAY_FORM => 0 ); + $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_CONFIRMMAILSENT => 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 ); + $template->param( DISPLAY_FORM => 0 ); + $template->param( DISPLAY_RESEND_FORM => 0 ); + $template->param( DISPLAY_CONFIRMMAILSENT => 0 ); + $template->param( DISPLAY_MAILSENT => 0 ); + $template->param( DISPLAY_PASSWORD_FORM => 1 ); } print $portal->header('text/html; charset=utf8'); diff --git a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl index ffedf0213..0fd5bfcb0 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl @@ -89,7 +89,7 @@ - +
@@ -97,6 +97,12 @@
+ +
+ +
+
+
- +