Add password first access error case in mail reset (#377)

This commit is contained in:
Clément Oudot 2011-11-04 15:37:42 +00:00
parent 1811394d43
commit 9b97d72584
4 changed files with 15 additions and 7 deletions

View File

@ -88,6 +88,7 @@ sub portalTab {
68 => 'PORTAL_CAS_SERVICE_NOT_ALLOWED', 68 => 'PORTAL_CAS_SERVICE_NOT_ALLOWED',
69 => 'PORTAL_MAILFIRSTACCESS', 69 => 'PORTAL_MAILFIRSTACCESS',
70 => 'PORTAL_MAILNOTFOUND', 70 => 'PORTAL_MAILNOTFOUND',
71 => 'PORTAL_PASSWORDFIRSTACCESS',
}; };
} }

View File

@ -311,8 +311,10 @@ sub changePassword {
# Else a password is required # Else a password is required
else { else {
return PE_PASSWORDFORMEMPTY unless ( $self->{newpassword} && $self->{confirmpassword} ) {
unless ( $self->{newpassword} && $self->{confirmpassword} ); return PE_PASSWORDFIRSTACCESS if ( $self->request_method =~ /GET/ );
return PE_PASSWORDFORMEMPTY;
}
} }
# Modify the password # Modify the password

View File

@ -140,6 +140,7 @@ use constant {
PE_CAS_SERVICE_NOT_ALLOWED => 68, PE_CAS_SERVICE_NOT_ALLOWED => 68,
PE_MAILFIRSTACCESS => 69, PE_MAILFIRSTACCESS => 69,
PE_MAILNOTFOUND => 70, PE_MAILNOTFOUND => 70,
PE_PASSWORDFIRSTACCESS => 71,
# Portal messages # Portal messages
PM_USER => 0, PM_USER => 0,
@ -184,7 +185,7 @@ our @EXPORT = qw( PE_IMG_NOK PE_IMG_OK PE_INFO PE_REDIRECT PE_DONE PE_OK
PE_SAML_LOAD_SP_ERROR PE_SAML_ATTR_ERROR PE_OPENID_EMPTY PE_OPENID_BADID PE_SAML_LOAD_SP_ERROR PE_SAML_ATTR_ERROR PE_OPENID_EMPTY PE_OPENID_BADID
PE_MISSINGREQATTR PE_BADPARTNER PE_MAILCONFIRMATION_ALREADY_SENT PE_MISSINGREQATTR PE_BADPARTNER PE_MAILCONFIRMATION_ALREADY_SENT
PE_PASSWORDFORMEMPTY PE_CAS_SERVICE_NOT_ALLOWED PE_MAILFIRSTACCESS PE_PASSWORDFORMEMPTY PE_CAS_SERVICE_NOT_ALLOWED PE_MAILFIRSTACCESS
PE_MAILNOTFOUND PE_MAILNOTFOUND PE_PASSWORDFIRSTACCESS
PM_USER PM_DATE PM_IP PM_SESSIONS_DELETED PM_OTHER_SESSIONS PM_USER PM_DATE PM_IP PM_SESSIONS_DELETED PM_OTHER_SESSIONS
PM_REMOVE_OTHER_SESSIONS PM_PP_GRACE PM_PP_EXP_WARNING PM_REMOVE_OTHER_SESSIONS PM_PP_GRACE PM_PP_EXP_WARNING
PM_SAML_IDPSELECT PM_SAML_IDPCHOOSEN PM_REMEMBERCHOICE PM_SAML_SPLOGOUT PM_SAML_IDPSELECT PM_SAML_IDPCHOOSEN PM_REMEMBERCHOICE PM_SAML_SPLOGOUT
@ -796,10 +797,10 @@ sub error_type {
if ( if (
scalar( scalar(
grep { /^$code$/ } ( grep { /^$code$/ } (
PE_REDIRECT, PE_DONE, PE_REDIRECT, PE_DONE,
PE_OK, PE_PASSWORD_OK, PE_OK, PE_PASSWORD_OK,
PE_MAILOK, PE_LOGOUT_OK, PE_MAILOK, PE_LOGOUT_OK,
PE_MAILFIRSTACCESS, PE_MAILFIRSTACCESS, PE_PASSWORDFIRSTACCESS,
) )
) )
); );

View File

@ -130,6 +130,7 @@ __END__
# * PE_CAS_SERVICE_NOT_ALLOWED 68 # * PE_CAS_SERVICE_NOT_ALLOWED 68
# * PE_MAILFIRSTACCESS 69 # * PE_MAILFIRSTACCESS 69
# * PE_MAILNOTFOUND 70 # * PE_MAILNOTFOUND 70
# * PE_PASSWORDFIRSTACCESS 71
# Not used in errors: # Not used in errors:
# * PE_DONE -1 # * PE_DONE -1
@ -212,6 +213,7 @@ sub error_fr {
'Accès non autorisé au service CAS', 'Accès non autorisé au service CAS',
'Merci de saisir votre adresse mail', 'Merci de saisir votre adresse mail',
'Pas d\'utilisateur correspondant', 'Pas d\'utilisateur correspondant',
'Merci de saisir votre nouveau mot de passe',
]; ];
} }
@ -291,6 +293,7 @@ sub error_en {
'Access non granted on CAS service', 'Access non granted on CAS service',
'Please provide your mail address', 'Please provide your mail address',
'No matching user', 'No matching user',
'Please provide your new password',
]; ];
} }
@ -371,6 +374,7 @@ sub error_ro {
'Access non granted on CAS service', 'Access non granted on CAS service',
'Vă rugăm să introduceţi adresa dvs. de e-mail', 'Vă rugăm să introduceţi adresa dvs. de e-mail',
'No matching user', 'No matching user',
'Please provide your new password',
]; ];
} }