branch feature/6844-forgotenPassword updated (0afd381 -> 6ff7c19)
This is an automated email from the git hooks/post-receive script. New change to branch feature/6844-forgotenPassword in repository wao. See http://git.codelutin.com/wao.git from 0afd381 Suppression de code mort (?) new 6ff7c19 refs 6844 En cas de succes du renouvellement de mot de passe, redirection vers page de login. Si mot de passe différent d'email alors redirection vers demande d'intervention sur site The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 6ff7c1974b22686444bcc6dfcfe778a37ac3dc2f Author: dcosse <cosse@codelutin.com> Date: Wed Apr 8 15:04:39 2015 +0200 refs 6844 En cas de succes du renouvellement de mot de passe, redirection vers page de login. Si mot de passe différent d'email alors redirection vers demande d'intervention sur site Summary of changes: .../authentication/ForgottenPasswordAction.java | 23 ++++++++++++++-------- .../main/resources/i18n/wao-web_en_GB.properties | 2 ++ .../main/resources/i18n/wao-web_fr_FR.properties | 2 ++ .../content/authentication/forgotten-password.jsp | 13 +++++------- 4 files changed, 24 insertions(+), 16 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/6844-forgotenPassword in repository wao. See http://git.codelutin.com/wao.git commit 6ff7c1974b22686444bcc6dfcfe778a37ac3dc2f Author: dcosse <cosse@codelutin.com> Date: Wed Apr 8 15:04:39 2015 +0200 refs 6844 En cas de succes du renouvellement de mot de passe, redirection vers page de login. Si mot de passe différent d'email alors redirection vers demande d'intervention sur site --- .../authentication/ForgottenPasswordAction.java | 23 ++++++++++++++-------- .../main/resources/i18n/wao-web_en_GB.properties | 2 ++ .../main/resources/i18n/wao-web_fr_FR.properties | 2 ++ .../content/authentication/forgotten-password.jsp | 13 +++++------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/ForgottenPasswordAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/ForgottenPasswordAction.java index ce49700..645303c 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/ForgottenPasswordAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/ForgottenPasswordAction.java @@ -4,14 +4,17 @@ import fr.ifremer.wao.services.service.administration.InactiveWaoUserException; import fr.ifremer.wao.services.service.administration.WaoUsersService; import fr.ifremer.wao.services.service.administration.WrongCredentialsException; import fr.ifremer.wao.web.WaoJspActionSupport; +import org.apache.commons.lang3.StringUtils; import org.apache.struts2.convention.annotation.Result; import org.apache.struts2.convention.annotation.Results; +import org.nuiton.util.StringUtil; /** * @since 5.1.2 */ @Results({ - @Result(name="success", type="redirectAction", params = { "namespace", "/authentication", "actionName", "forgotten-password!input", "recovered", "%{recovered}", "login", "%{login}"}) + @Result(name="success", type="redirectAction", params = { "namespace", "/authentication", "actionName", "login!input", "login", "%{login}"}), + @Result(name="none", type="redirectAction", params = { "namespace", "/authentication", "actionName", "forgotten-password!input", "failedNotEmail", "%{failedNotEmail}"}) }) public class ForgottenPasswordAction extends WaoJspActionSupport { @@ -21,7 +24,7 @@ public class ForgottenPasswordAction extends WaoJspActionSupport { protected String login; - protected boolean recovered; + protected boolean failedNotEmail; public void setService(WaoUsersService service) { this.service = service; @@ -30,10 +33,14 @@ public class ForgottenPasswordAction extends WaoJspActionSupport { @Override public String execute() { + if (StringUtils.isNotBlank(login) && ! StringUtil.isEmail(login) ) { + failedNotEmail = true; + return NONE; + } + try { service.askForPasswordReminder(login); - recovered = true; - addActionMessage(t("wao.ui.reminderSent")); + session.addMessage(t("wao.ui.reminderSent")); } catch (WrongCredentialsException credentialException) { addFieldError("login", t("wao.ui.form.authentication.error.wrongCredentials")); return INPUT; @@ -53,11 +60,11 @@ public class ForgottenPasswordAction extends WaoJspActionSupport { return login; } - public boolean isRecovered() { - return recovered; + public boolean isFailedNotEmail() { + return failedNotEmail; } - public void setRecovered(boolean recovered) { - this.recovered = recovered; + public void setFailedNotEmail(boolean failedNotEmail) { + this.failedNotEmail = failedNotEmail; } } diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties index 1ed6cc8..5512b5f 100644 --- a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties +++ b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties @@ -380,6 +380,7 @@ wao.ui.form.authentication.error.userMustAcceptCgu=You must accept the end-user wao.ui.form.authentication.error.wrongCredentials=Incorrect credentials wao.ui.form.authentication.forgottenPassword.recoverButton=Reset password wao.ui.form.authentication.forgottenPassword.title=Reset your WAO's password +wao.ui.form.authentication.redirectToSIH=Request to intervene on site wao.ui.form.authentication.title=WAO authentication wao.ui.form.boardingFrom=Boardings since wao.ui.form.boatName.placeholder=Name of boat @@ -511,6 +512,7 @@ wao.ui.misc.week=Week wao.ui.misc.year=Year wao.ui.misc.yes=Yes wao.ui.nContactsFound=%s contacts found +wao.ui.needForIntervene=We are not able the recover your password, please feel up a request for intervene on site. wao.ui.news.content=Text wao.ui.news.title=Title wao.ui.page.Administration.title=Administration diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties index f0bba41..c42c311 100644 --- a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties +++ b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties @@ -381,6 +381,7 @@ wao.ui.form.authentication.error.userMustAcceptCgu=Vous devez accepter les condi wao.ui.form.authentication.error.wrongCredentials=Les informations d'authenfication ne sont pas correctes wao.ui.form.authentication.forgottenPassword.recoverButton=Demander un nouveau mot de passe wao.ui.form.authentication.forgottenPassword.title=Récupération de votre mot de passe WAO +wao.ui.form.authentication.redirectToSIH=Demande d'intervention sur site wao.ui.form.authentication.title=Identification WAO wao.ui.form.boardingFrom=Sollicitations du navire depuis le wao.ui.form.boatName.placeholder=Nom du bateau @@ -512,6 +513,7 @@ wao.ui.misc.week=Semaine wao.ui.misc.year=Année wao.ui.misc.yes=Oui wao.ui.nContactsFound=%s contacts trouvés +wao.ui.needForIntervene=Nous ne pouvons procéder au renouvellement de votre mot de passe, merci de rédiger une demande d’intervention sur le site. wao.ui.news.content=Texte wao.ui.news.title=Titre wao.ui.page.Administration.title=Administration diff --git a/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-password.jsp b/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-password.jsp index 8fa421e..05c1401 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-password.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-password.jsp @@ -17,8 +17,8 @@ <s:form action="forgotten-password" namespace="/authentication" method="POST" cssClass="form-horizontal"> <fieldset> - <s:if test="recovered"> - <s:text name="wao.ui.reminderSent"/> + <s:if test="failedNotEmail"> + <s:text name="wao.ui.needForIntervene"/> </s:if> <s:else> <s:textfield name="login" @@ -27,12 +27,9 @@ </fieldset> <div class="form-actions"> - <s:if test="recovered"> - <s:url namespace="/authentication" action="login!input" id="loginUrl"> - <s:param name="login" value="login" /> - </s:url> - <s:a href="%{loginUrl}" cssClass="btn"> - <s:text name="wao.ui.form.authentication.action.submit"/> + <s:if test="failedNotEmail"> + <s:a href="http://forms.ifremer.fr/sih/wao-demande-dintervention-sur-le-site/" cssClass="btn"> + <s:text name="wao.ui.form.authentication.redirectToSIH"/> </s:a> </s:if> <s:else> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm