From scm@users.codelutin.com Thu Apr  9 13:20:16 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  01/13: refs 6844 Remise en place de la =?utf-8?q?fon?=
 =?utf-8?q?ctionnalit=C3=A9_de_demande_de_r=C3=A9initialisation?= de mot de
 passe
Date: Thu, 09 Apr 2015 13:20:14 +0000
Message-ID: <20150409132016.83E705C4719@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0740896749229880267=="

--===============0740896749229880267==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 6955ed4f77d88c859f4c24d7fa51122413ebec5c
Author: dcosse <cosse@codelutin.com>
Date:   Fri Mar 27 16:35:59 2015 +0100

    refs 6844 Remise en place de la fonctionnalit=C3=A9 de demande de r=C3=A9=
initialisation de mot de passe
---
 .../service/administration/WaoUsersService.java    | 37 +++++++++++
 .../java/fr/ifremer/wao/web/WaoInterceptor.java    |  5 +-
 .../authentication/ForgottenPasswordAction.java    | 71 ++++++++++++++++++++=
++
 .../main/resources/i18n/wao-web_en_GB.properties   |  3 +
 .../main/resources/i18n/wao-web_fr_FR.properties   |  3 +
 .../content/authentication/forgotten-password.jsp  | 48 +++++++++++++++
 .../WEB-INF/content/authentication/login.jsp       | 22 ++++++-
 wao-web/src/main/webapp/WEB-INF/decorators.xml     |  1 +
 8 files changed, 187 insertions(+), 3 deletions(-)

diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/admin=
istration/WaoUsersService.java b/wao-services/src/main/java/fr/ifremer/wao/se=
rvices/service/administration/WaoUsersService.java
index 6bead99..2e31b91 100644
--- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersService.java
+++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersService.java
@@ -291,4 +291,41 @@ public class WaoUsersService extends WaoServiceSupport {
         commit();
=20
     }
+
+    protected UpdateWaoUserCommand getPasswordRecoveryUpdateWaoUserCommand(W=
aoUser waoUser) {
+        UpdateWaoUserCommand updateWaoUserCommand =3D new UpdateWaoUserComma=
nd();
+        updateWaoUserCommand.setWaoUser(waoUser);
+        updateWaoUserCommand.setPasswordStrategy(UpdateWaoUserCommandPasswor=
dStrategy.GENERATE_NEW_PASSWORD);
+        updateWaoUserCommand.setPasswordStrategies(UpdateWaoUserCommandPassw=
ordStrategy.getPasswordStrategiesForWaoUserCreation());
+        return updateWaoUserCommand;
+    }
+
+    public void askForPasswordReminder(String login) throws WrongCredentials=
Exception, InactiveWaoUserException, NoRoleAttributedException {
+        WaoUserTopiaDao dao =3D getWaoUserDao();
+
+        Optional<WaoUser> optionalWaoUser =3D dao.tryFindByEmailAndFetchColl=
ections(login);
+
+        WaoUser waoUser;
+
+        if ( ! optionalWaoUser.isPresent()) {
+            if (log.isInfoEnabled()) {
+                log.info("no such user " + login);
+            }
+            throw new WrongCredentialsException();
+        }
+
+        waoUser =3D optionalWaoUser.get();
+
+        if ( ! waoUser.isActive()) {
+            throw new InactiveWaoUserException(waoUser);
+        }
+
+        if (waoUser.isUserProfileEmpty()) {
+            throw new NoRoleAttributedException(waoUser);
+        }
+
+        UpdateWaoUserCommand updateWaoUserCommand =3D getPasswordRecoveryUpd=
ateWaoUserCommand(waoUser);
+
+        save(updateWaoUserCommand);
+    }
 }
diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java b/w=
ao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java
index 448c87e..a36cc45 100644
--- a/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java
+++ b/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java
@@ -30,6 +30,7 @@ import fr.ifremer.wao.WaoTopiaPersistenceContext;
 import fr.ifremer.wao.services.WaoApplicationContext;
 import fr.ifremer.wao.services.WaoService;
 import fr.ifremer.wao.services.WaoServiceContext;
+import fr.ifremer.wao.web.action.authentication.ForgottenPasswordAction;
 import fr.ifremer.wao.web.action.authentication.LoginAction;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.logging.Log;
@@ -44,8 +45,8 @@ public class WaoInterceptor implements Interceptor {
=20
     private static final Log log =3D LogFactory.getLog(WaoInterceptor.class);
=20
-    protected static final ImmutableSet<Class<LoginAction>> ACTIONS_ACCESSIB=
LE_WITHOUT_LOGIN =3D
-            ImmutableSet.of(LoginAction.class);
+    protected static final ImmutableSet<Class<? extends WaoJspActionSupport>=
> ACTIONS_ACCESSIBLE_WITHOUT_LOGIN =3D
+            ImmutableSet.of(LoginAction.class, ForgottenPasswordAction.class=
);
=20
     @Override
     public void init() {
diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/F=
orgottenPasswordAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action=
/authentication/ForgottenPasswordAction.java
new file mode 100644
index 0000000..e3cb2ec
--- /dev/null
+++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/Forgotte=
nPasswordAction.java
@@ -0,0 +1,71 @@
+package fr.ifremer.wao.web.action.authentication;
+
+import fr.ifremer.wao.services.service.administration.InactiveWaoUserExcepti=
on;
+import fr.ifremer.wao.services.service.administration.NoRoleAttributedExcept=
ion;
+import fr.ifremer.wao.services.service.administration.WaoUsersService;
+import fr.ifremer.wao.services.service.administration.WrongCredentialsExcept=
ion;
+import fr.ifremer.wao.web.WaoJspActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Result;
+
+/**
+ * Created by davidcosse on 26/03/15.
+ */
+public class ForgottenPasswordAction extends WaoJspActionSupport {
+
+    private static final long serialVersionUID =3D 1L;
+
+    protected transient WaoUsersService service;
+
+    protected String login;
+
+    protected boolean recovered;
+
+    public void setService(WaoUsersService service) {
+        this.service =3D service;
+    }
+
+    @Override
+    @Action("forgotten-password-input")
+    public String input() throws Exception {
+        return super.input();
+    }
+
+    @Override
+    @Action(results =3D {
+            @Result(name=3D"success", type=3D"redirectAction", params =3D { =
"namespace", "/authentication", "actionName",  "forgotten-password!input", "r=
ecovered", "%{recovered}", "login", "%{login}"})})
+    public String execute() throws Exception {
+        try {
+            service.askForPasswordReminder(login);
+            recovered =3D true;
+            addActionMessage(t("wao.ui.reminderSent"));
+        } catch (WrongCredentialsException credentialException) {
+            addFieldError("login", t("wao.ui.form.authentication.error.wrong=
Credentials"));
+            return INPUT;
+        } catch (InactiveWaoUserException inactiveWaoUserException) {
+            addFieldError("login", t("wao.ui.form.authentication.error.noRol=
eAttributed"));
+            return INPUT;
+        } catch (NoRoleAttributedException noRoleAttributedException) {
+            addFieldError("login", t("wao.ui.form.authentication.error.inact=
iveWaoUser"));
+            return INPUT;
+        }
+
+        return SUCCESS;
+    }
+
+    public void setLogin(String login) {
+        this.login =3D login;
+    }
+
+    public String getLogin() {
+        return login;
+    }
+
+    public boolean isRecovered() {
+        return recovered;
+    }
+
+    public void setRecovered(boolean recovered) {
+        this.recovered =3D recovered;
+    }
+}
diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_en_GB.properties
index 98da054..303aee2 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
@@ -378,6 +378,8 @@ wao.ui.form.authentication.error.inactiveWaoUser=3DThis w=
ao user is not active. Pl
 wao.ui.form.authentication.error.noRoleAttributed=3DThis wao user has no rol=
e affected. Please, contact an administrator
 wao.ui.form.authentication.error.userMustAcceptCgu=3DYou must accept the end=
-user agreement
 wao.ui.form.authentication.error.wrongCredentials=3DIncorrect credentials
+wao.ui.form.authentication.forgottenPassword.recoverButton=3DRESET PASSWORD
+wao.ui.form.authentication.forgottenPassword.title=3DReset your WAO's passwo=
rd
 wao.ui.form.authentication.title=3DWAO authentication
 wao.ui.form.boardingFrom=3DBoardings since
 wao.ui.form.boatName.placeholder=3DName of boat
@@ -530,6 +532,7 @@ wao.ui.page.waoUsers.titleForCompany=3DUsers for company =
%s
 wao.ui.periodToMustBeAfterPeriodFrom=3DThe end of the period must be after t=
he beginning
 wao.ui.publishedByProgram=3DPusblished by program
 wao.ui.publishedByYourCompany=3DPublished by company
+wao.ui.reminderSent=3D
 wao.ui.removeBoatEligibility.confirm=3DAre you sure you want to make this bo=
at ineligible for sample row ?
 wao.ui.sampleRow.creation=3DCreation of a sample row
 wao.ui.sampleRow.edition=3DEdition of line %s
diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_fr_FR.properties
index 00b2b0d..68f026d 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
@@ -379,6 +379,8 @@ wao.ui.form.authentication.error.inactiveWaoUser=3DCe com=
pte est inactif, veuillez
 wao.ui.form.authentication.error.noRoleAttributed=3DAucun r=C3=B4le n'est at=
tribu=C3=A9 =C3=A0 ce compte, veuillez contacter un responsable
 wao.ui.form.authentication.error.userMustAcceptCgu=3DVous devez accepter les=
 conditions g=C3=A9n=C3=A9rales d'utilisation
 wao.ui.form.authentication.error.wrongCredentials=3DLes informations d'authe=
nfication ne sont pas correctes
+wao.ui.form.authentication.forgottenPassword.recoverButton=3DR=C3=89INITIALI=
SER
+wao.ui.form.authentication.forgottenPassword.title=3DR=C3=A9cup=C3=A9ration =
de votre mot de passe WAO
 wao.ui.form.authentication.title=3DIdentification WAO
 wao.ui.form.boardingFrom=3DSollicitations du navire depuis le
 wao.ui.form.boatName.placeholder=3DNom du bateau
@@ -531,6 +533,7 @@ wao.ui.page.waoUsers.titleForCompany=3DUtilisateurs de la=
 soci=C3=A9t=C3=A9 %s
 wao.ui.periodToMustBeAfterPeriodFrom=3DLa p=C3=A9riode de temps doit se term=
iner apr=C3=A8s avoir commenc=C3=A9
 wao.ui.publishedByProgram=3DPubli=C3=A9e par le programme
 wao.ui.publishedByYourCompany=3DPubli=C3=A9e par la soci=C3=A9t=C3=A9
+wao.ui.reminderSent=3DEmail de r=C3=A9cup=C3=A9ration du mot de passe envoy=
=C3=A9, consultez votre bo=C3=AEte mail
 wao.ui.removeBoatEligibility.confirm=3D=C3=8Ates-vous s=C3=BBr de vouloir re=
ndre le navire in=C3=A9ligible pour cette ligne ?
 wao.ui.sampleRow.creation=3DCr=C3=A9ation d'une ligne du plan d'=C3=A9chanti=
llonnage
 wao.ui.sampleRow.edition=3DModification de la ligne %s
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/forgot=
ten-password.jsp
new file mode 100644
index 0000000..8fa421e
--- /dev/null
+++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-passwo=
rd.jsp
@@ -0,0 +1,48 @@
+<%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>
+<%@taglib prefix=3D"s" uri=3D"/struts-tags" %>
+<%@taglib prefix=3D"sj" uri=3D"/struts-jquery-tags" %>
+
+<html>
+    <head>
+        <title>
+            <s:text name=3D"wao.ui.form.authentication.forgottenPassword.tit=
le" />
+        </title>
+    </head>
+    <body>
+
+        <h1>
+            <s:text name=3D"wao.ui.form.authentication.forgottenPassword.tit=
le" />
+        </h1>
+
+        <s:form action=3D"forgotten-password" namespace=3D"/authentication" =
method=3D"POST" cssClass=3D"form-horizontal">
+
+            <fieldset>
+                <s:if test=3D"recovered">
+                    <s:text name=3D"wao.ui.reminderSent"/>
+                </s:if>
+                <s:else>
+                    <s:textfield name=3D"login"
+                                 label=3D"%{getText('wao.ui.field.WaoUser.lo=
gin')}"/>
+                </s:else>
+            </fieldset>
+
+            <div class=3D"form-actions">
+                <s:if test=3D"recovered">
+                    <s:url namespace=3D"/authentication" action=3D"login!inp=
ut" id=3D"loginUrl">
+                        <s:param name=3D"login" value=3D"login" />
+                    </s:url>
+                    <s:a href=3D"%{loginUrl}" cssClass=3D"btn">
+                        <s:text name=3D"wao.ui.form.authentication.action.su=
bmit"/>
+                    </s:a>
+                </s:if>
+                <s:else>
+                    <s:submit type=3D"button" cssClass=3D"btn btn-primary">
+                        <s:text name=3D"wao.ui.form.authentication.forgotten=
Password.recoverButton"/>
+                    </s:submit>
+                </s:else>
+            </div>
+
+        </s:form>
+
+    </body>
+</html>
diff --git a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp=
 b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
index 2e13d0a..41382b4 100644
--- a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
+++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
@@ -19,7 +19,7 @@
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>
-<%@taglib  prefix=3D"s" uri=3D"/struts-tags" %>
+<%@taglib prefix=3D"s" uri=3D"/struts-tags" %>
 <%@taglib prefix=3D"sj" uri=3D"/struts-jquery-tags" %>
=20
 <html>
@@ -32,6 +32,11 @@
                 $('input[name=3D"login"]').focus();
             });
         </script>
+        <script type=3D"text/javascript">
+          function getLogin() {
+            return login =3D $('input[name=3D"login"]').val();
+          }
+        </script>
     </head>
     <body>
=20
@@ -60,6 +65,14 @@
=20
                 </s:else>
=20
+                <s:if test=3D"credentialsAsked">
+                    <s:url namespace=3D"/authentication" action=3D"forgotten=
-password" id=3D"recoverPasswordURL">
+                    </s:url>
+                    <s:a href=3D"%{recoverPasswordURL}">
+                        <s:text name=3D"wao.ui.forgotPassword"/>
+                    </s:a>
+                </s:if>
+
                 <s:if test=3D"userProfileAsked">
=20
                     <s:radio name=3D"userProfileId" list=3D"userProfiles" la=
bel=3D"%{getText('wao.ui.form.authentication.chooseUserProfile')}" />
@@ -75,6 +88,13 @@
             </fieldset>
=20
             <div class=3D"form-actions">
+                <s:if test=3D"credentialsAsked">
+                    <s:submit type=3D"button" cssClass=3D"btn btn-primary">
+                        <s:param name=3D"userPassordReminderAsked">true</s:p=
aram>
+                        <s:text name=3D"wao.ui.forgotPassword"/>
+                    </s:submit>
+                </s:if>
+
                 <s:submit type=3D"button" cssClass=3D"btn btn-primary">
                     <s:text name=3D"wao.ui.form.authentication.action.submit=
"/>
                 </s:submit>
diff --git a/wao-web/src/main/webapp/WEB-INF/decorators.xml b/wao-web/src/mai=
n/webapp/WEB-INF/decorators.xml
index 774ea9f..a6bce8d 100644
--- a/wao-web/src/main/webapp/WEB-INF/decorators.xml
+++ b/wao-web/src/main/webapp/WEB-INF/decorators.xml
@@ -28,6 +28,7 @@
=20
   <decorator name=3D"layout-login" page=3D"layout-login.jsp">
     <pattern>/authentication/login*</pattern>
+    <pattern>/authentication/forgotten-password*</pattern>
   </decorator>
=20
   <decorator name=3D"layout" page=3D"layout.jsp">

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============0740896749229880267==--


From scm@users.codelutin.com Thu Apr  9 13:20:16 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits] branch develop updated (adcd234 -> 21521ad)
Date: Thu, 09 Apr 2015 13:20:13 +0000
Message-ID: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6606783840614549201=="

--===============6606783840614549201==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New change to branch develop in repository wao.

See http://git.codelutin.com/wao.git

      from  adcd234   [jgitflow-maven-plugin]Updating develop poms back to pr=
e merge state
       new  6955ed4   refs 6844 Remise en place de la fonctionnalit=C3=A9 de =
demande de r=C3=A9initialisation de mot de passe
       new  8d401db   Ajout d'une m=C3=A9thode save sur AbstractWaoTopiaDao
       new  020efa1   Dans le jeu de donn=C3=A9es de test, on fait en sorte q=
ue chaque utilisateur fictif ait un mot de passe (le m=C3=AAme pour tout le m=
onde)
       new  5d86c42   Dans le bundle i18n, on =C3=A9crit en casse normale, si=
 on veut des majuscules =C3=A0 l'affichage, c'est un question de style, =C3=
=A0 faire en CSS
       new  c256595   Pas la peine d'afficher deux boutons pour =C2=AB Mot de=
 passe oubli=C3=A9 =C2=BB, pas la peine de l'afficher si la personne a r=C3=
=A9ussi =C3=A0 s'authentifi=C3=A9e (=C3=A9tape de choix du profil ou acceptat=
ion CGU)
       new  c23a182   Pas besoin de surcharger input() juste pour appeller su=
per, on d=C3=A9finit les @Result en haut de l'action (comme dans le reste de =
l'appli), aucune raison d'avoir =C3=A0 catcher une NoRoleAttributedException =
=C3=A0 ce moment
       new  d53a19e   Ajout d'un test pour v=C3=A9rifier le bon fonctionnemen=
t de la demande de renouvellement de mot de passe
       new  229ead8   Remaniement de askForPasswordReminder pour r=C3=A9utili=
ser du code au sein de WaoUsersService
       new  060144c   Ajout d'une valeur i18n manquante
       new  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=C3=A9rent d'email=
 alors redirection vers demande d'intervention sur site
       new  957035a   Refs #6844 : Syntaxical correction
       new  21521ad   Fusion de la branche 'feature/6844-forgotenPassword' da=
ns develop (termine #6844)

The 13 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 21521ad790eac9f04852feb30b01f96ba734237d
Merge: adcd234 957035a
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Thu Apr 9 15:18:55 2015 +0200

    Fusion de la branche 'feature/6844-forgotenPassword' dans develop (termin=
e #6844)

commit 957035a31730ce279226408cbb3ce7165d816998
Author: L=C3=A9o Kaufmann <kaufmann@codelutin.com>
Date:   Thu Apr 9 15:07:55 2015 +0200

    Refs #6844 : Syntaxical correction

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=C3=A9rent d'email alors redirection=
 vers demande d'intervention sur site

commit 0afd3815f924c096f60ee24e84241b8be91b2023
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:21:30 2015 +0200

    Suppression de code mort (?)

commit 060144c9eb31e4d10a411585863b57568db81a88
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:16:55 2015 +0200

    Ajout d'une valeur i18n manquante

commit 229ead8e0b9204d01f0cba30584cb612d74649ae
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:53 2015 +0200

    Remaniement de askForPasswordReminder pour r=C3=A9utiliser du code au sei=
n de WaoUsersService

commit d53a19e3e60fe54d76d42bcab82aeb98e3ce3f35
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:28 2015 +0200

    Ajout d'un test pour v=C3=A9rifier le bon fonctionnement de la demande de=
 renouvellement de mot de passe

commit c23a182ef0a557bd07cf207e98021b57323ae354
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:18 2015 +0200

    Pas besoin de surcharger input() juste pour appeller super, on d=C3=A9fin=
it les @Result en haut de l'action (comme dans le reste de l'appli), aucune r=
aison d'avoir =C3=A0 catcher une NoRoleAttributedException =C3=A0 ce moment

commit c2565950475e8bb627b0b8cc45754a3fd98ebf7b
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:10:46 2015 +0200

    Pas la peine d'afficher deux boutons pour =C2=AB Mot de passe oubli=C3=A9=
 =C2=BB, pas la peine de l'afficher si la personne a r=C3=A9ussi =C3=A0 s'aut=
hentifi=C3=A9e (=C3=A9tape de choix du profil ou acceptation CGU)

commit 5d86c42a1dad6309100db817b19aa8da49a723c0
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:08:41 2015 +0200

    Dans le bundle i18n, on =C3=A9crit en casse normale, si on veut des majus=
cules =C3=A0 l'affichage, c'est un question de style, =C3=A0 faire en CSS

commit 020efa17d198339e52711d6dd41dd2ea2467b290
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:08:04 2015 +0200

    Dans le jeu de donn=C3=A9es de test, on fait en sorte que chaque utilisat=
eur fictif ait un mot de passe (le m=C3=AAme pour tout le monde)

commit 8d401db4c434c1142fefe31bd1e797536ded755e
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:06:50 2015 +0200

    Ajout d'une m=C3=A9thode save sur AbstractWaoTopiaDao

commit 6955ed4f77d88c859f4c24d7fa51122413ebec5c
Author: dcosse <cosse@codelutin.com>
Date:   Fri Mar 27 16:35:59 2015 +0100

    refs 6844 Remise en place de la fonctionnalit=C3=A9 de demande de r=C3=A9=
initialisation de mot de passe

Summary of changes:
 .../java/fr/ifremer/wao/AbstractWaoTopiaDao.java   | 14 ++--
 .../src/main/java/fr/ifremer/wao/WaoUtils.java     |  5 ++
 .../service/administration/WaoUsersService.java    | 94 ++++++++++++++------=
--
 .../email/UserCredentialsEmail_fr.mustache         |  2 +-
 .../wao/services/service/ObsMerFixtures.java       |  4 +
 .../ifremer/wao/services/service/WaoFixtures.java  |  9 +++
 .../administration/WaoUsersServiceTest.java        | 44 ++++++++++
 .../java/fr/ifremer/wao/web/WaoInterceptor.java    |  5 +-
 .../authentication/ForgottenPasswordAction.java    | 70 ++++++++++++++++
 .../main/resources/i18n/wao-web_en_GB.properties   |  5 ++
 .../main/resources/i18n/wao-web_fr_FR.properties   |  5 ++
 .../content/authentication/forgotten-password.jsp  | 45 +++++++++++
 .../WEB-INF/content/authentication/login.jsp       | 18 +++--
 wao-web/src/main/webapp/WEB-INF/decorators.xml     |  1 +
 14 files changed, 276 insertions(+), 45 deletions(-)
 create mode 100644 wao-web/src/main/java/fr/ifremer/wao/web/action/authentic=
ation/ForgottenPasswordAction.java
 create mode 100644 wao-web/src/main/webapp/WEB-INF/content/authentication/fo=
rgotten-password.jsp

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============6606783840614549201==--


From scm@users.codelutin.com Thu Apr  9 13:20:17 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  05/13: Pas la peine d'afficher deux boutons pour 
 =?utf-8?q?=C2=AB?= Mot de passe =?utf-8?q?oubli=C3=A9?= =?utf-8?b?wrss?= pas
 la peine de l'afficher si la personne a =?utf-8?b?csOpdXNzaSDDoCBzJ2F1?=
 =?utf-8?q?thentifi=C3=A9e_=28=C3=A9tape?= de choix du profil ou acceptation
 CGU)
Date: Thu, 09 Apr 2015 13:20:18 +0000
Message-ID: <20150409132017.969345C4719@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0900549532258100208=="

--===============0900549532258100208==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit c2565950475e8bb627b0b8cc45754a3fd98ebf7b
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:10:46 2015 +0200

    Pas la peine d'afficher deux boutons pour =C2=AB Mot de passe oubli=C3=A9=
 =C2=BB, pas la peine de l'afficher si la personne a r=C3=A9ussi =C3=A0 s'aut=
hentifi=C3=A9e (=C3=A9tape de choix du profil ou acceptation CGU)
---
 .../WEB-INF/content/authentication/login.jsp       | 31 +++++++++-----------=
--
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp=
 b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
index 41382b4..3aeb73b 100644
--- a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
+++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
@@ -65,14 +65,6 @@
=20
                 </s:else>
=20
-                <s:if test=3D"credentialsAsked">
-                    <s:url namespace=3D"/authentication" action=3D"forgotten=
-password" id=3D"recoverPasswordURL">
-                    </s:url>
-                    <s:a href=3D"%{recoverPasswordURL}">
-                        <s:text name=3D"wao.ui.forgotPassword"/>
-                    </s:a>
-                </s:if>
-
                 <s:if test=3D"userProfileAsked">
=20
                     <s:radio name=3D"userProfileId" list=3D"userProfiles" la=
bel=3D"%{getText('wao.ui.form.authentication.chooseUserProfile')}" />
@@ -88,21 +80,22 @@
             </fieldset>
=20
             <div class=3D"form-actions">
-                <s:if test=3D"credentialsAsked">
-                    <s:submit type=3D"button" cssClass=3D"btn btn-primary">
-                        <s:param name=3D"userPassordReminderAsked">true</s:p=
aram>
-                        <s:text name=3D"wao.ui.forgotPassword"/>
-                    </s:submit>
-                </s:if>
-
                 <s:submit type=3D"button" cssClass=3D"btn btn-primary">
                     <s:text name=3D"wao.ui.form.authentication.action.submit=
"/>
                 </s:submit>
=20
-                <s:url namespace=3D"/authentication" action=3D"login!input" =
id=3D"cancelUrl"/>
-                <s:a href=3D"%{cancelUrl}" cssClass=3D"btn">
-                    <s:text name=3D"wao.ui.action.cancel"/>
-                </s:a>
+                <s:if test=3D"userProfileAsked || acceptCguAsked">
+                    <s:url namespace=3D"/authentication" action=3D"login!inp=
ut" id=3D"cancelUrl"/>
+                    <s:a href=3D"%{cancelUrl}" cssClass=3D"btn">
+                        <s:text name=3D"wao.ui.action.cancel"/>
+                    </s:a>
+                </s:if>
+                <s:else>
+                    <s:url namespace=3D"/authentication" action=3D"forgotten=
-password!input" id=3D"recoverPasswordUrl" />
+                    <s:a href=3D"%{recoverPasswordUrl}" cssClass=3D"btn btn-=
link">
+                        <s:text name=3D"wao.ui.forgotPassword"/>
+                    </s:a>
+                </s:else>
             </div>
=20
         </s:form>

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============0900549532258100208==--


From scm@users.codelutin.com Thu Apr  9 13:20:17 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  02/13: Ajout d'une =?utf-8?q?m=C3=A9thode?= save sur
 AbstractWaoTopiaDao
Date: Thu, 09 Apr 2015 13:20:15 +0000
Message-ID: <20150409132016.C94C45C510D@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7193632368020608778=="

--===============7193632368020608778==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 8d401db4c434c1142fefe31bd1e797536ded755e
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:06:50 2015 +0200

    Ajout d'une m=C3=A9thode save sur AbstractWaoTopiaDao
---
 .../src/main/java/fr/ifremer/wao/AbstractWaoTopiaDao.java  | 14 +++++++++---=
--
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/AbstractWaoTopiaDao=
.java b/wao-persistence/src/main/java/fr/ifremer/wao/AbstractWaoTopiaDao.java
index 67103d7..c587fad 100644
--- a/wao-persistence/src/main/java/fr/ifremer/wao/AbstractWaoTopiaDao.java
+++ b/wao-persistence/src/main/java/fr/ifremer/wao/AbstractWaoTopiaDao.java
@@ -31,11 +31,15 @@ public abstract class AbstractWaoTopiaDao<E extends Topia=
Entity> extends Abstrac
=20
     public void saveNullable(E entity) {
         if (entity !=3D null) {
-            if (entity.isPersisted()) {
-                update(entity);
-            } else {
-                create(entity);
-            }
+            save(entity);
+        }
+    }
+
+    public void save(E entity) {
+        if (entity.isPersisted()) {
+            update(entity);
+        } else {
+            create(entity);
         }
     }
=20

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============7193632368020608778==--


From scm@users.codelutin.com Thu Apr  9 13:20:17 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  03/13: Dans le jeu de =?utf-8?q?donn=C3=A9es?= de
 test, on fait en sorte que chaque utilisateur fictif ait un mot de passe (le 
 =?utf-8?q?_?==?utf-8?q?m=C3=AAme?= pour tout le monde)
Date: Thu, 09 Apr 2015 13:20:16 +0000
Message-ID: <20150409132017.1415D5C616F@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2693416985383608810=="

--===============2693416985383608810==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 020efa17d198339e52711d6dd41dd2ea2467b290
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:08:04 2015 +0200

    Dans le jeu de donn=C3=A9es de test, on fait en sorte que chaque utilisat=
eur fictif ait un mot de passe (le m=C3=AAme pour tout le monde)
---
 .../java/fr/ifremer/wao/services/service/ObsMerFixtures.java     | 4 ++++
 .../test/java/fr/ifremer/wao/services/service/WaoFixtures.java   | 9 +++++++=
++
 2 files changed, 13 insertions(+)

diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMe=
rFixtures.java b/wao-services/src/test/java/fr/ifremer/wao/services/service/O=
bsMerFixtures.java
index fa8a3bf..ed39904 100644
--- a/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerFixtur=
es.java
+++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerFixtur=
es.java
@@ -48,6 +48,10 @@ public class ObsMerFixtures extends WaoFixtures {
         return newAuthenticatedWaoUser("jmichmuche", ObsProgram.OBSMER, User=
Role.COORDINATOR, ifremer());
     }
=20
+    public AuthenticatedWaoUser robert() {
+        return newAuthenticatedWaoUser("robert@codelutin.com", ObsProgram.OB=
SMER, UserRole.COORDINATOR, ifremer());
+    }
+
     public void samplingPlan() {
         ifremer();
         oceanet();
diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/WaoFi=
xtures.java b/wao-services/src/test/java/fr/ifremer/wao/services/service/WaoF=
ixtures.java
index 1235c60..61bc1e3 100644
--- a/wao-services/src/test/java/fr/ifremer/wao/services/service/WaoFixtures.=
java
+++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/WaoFixtures.=
java
@@ -23,6 +23,7 @@ package fr.ifremer.wao.services.service;
=20
 import com.google.common.collect.Iterables;
 import fr.ifremer.wao.WaoTechnicalException;
+import fr.ifremer.wao.WaoUtils;
 import fr.ifremer.wao.entity.Company;
 import fr.ifremer.wao.entity.CompanyTopiaDao;
 import fr.ifremer.wao.entity.Laboratory;
@@ -91,6 +92,7 @@ public class WaoFixtures {
             waoUser =3D new WaoUserImpl();
             waoUser.setOrganisation(organisation);
             waoUser.setLogin(login);
+            waoUser.setPassword(WaoUtils.hashPassword(fakePassword()));
             waoUser.setFirstName("Pr=C3=A9nom de " + login);
             waoUser.setLastName("Nom de " + login);
             waoUser.setActive(true);
@@ -105,6 +107,13 @@ public class WaoFixtures {
         return new AuthenticatedWaoUser(waoUser, Iterables.getOnlyElement(wa=
oUser.getUserProfile()));
     }
=20
+    /**
+     * @return le mot de passe de tous les utilisateurs des fixtures
+     */
+    public String fakePassword() {
+        return "fakePassword";
+    }
+
     public Company ifremer() {
         return getCompany("IFREMER", true);
     }

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============2693416985383608810==--


From scm@users.codelutin.com Thu Apr  9 13:20:17 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  04/13: Dans le bundle i18n, on =?utf-8?q?=C3=A9crit?=
 en casse normale, si on veut des majuscules =?utf-8?q?=C3=A0?= l'affichage,
 c'est un question de style, =?utf-8?q?=C3=A0?= faire en CSS
Date: Thu, 09 Apr 2015 13:20:17 +0000
Message-ID: <20150409132017.4D1445C4FB1@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8265240484792232984=="

--===============8265240484792232984==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 5d86c42a1dad6309100db817b19aa8da49a723c0
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:08:41 2015 +0200

    Dans le bundle i18n, on =C3=A9crit en casse normale, si on veut des majus=
cules =C3=A0 l'affichage, c'est un question de style, =C3=A0 faire en CSS
---
 wao-web/src/main/resources/i18n/wao-web_en_GB.properties | 2 +-
 wao-web/src/main/resources/i18n/wao-web_fr_FR.properties | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_en_GB.properties
index 303aee2..53cd06c 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
@@ -378,7 +378,7 @@ wao.ui.form.authentication.error.inactiveWaoUser=3DThis w=
ao user is not active. Pl
 wao.ui.form.authentication.error.noRoleAttributed=3DThis wao user has no rol=
e affected. Please, contact an administrator
 wao.ui.form.authentication.error.userMustAcceptCgu=3DYou must accept the end=
-user agreement
 wao.ui.form.authentication.error.wrongCredentials=3DIncorrect credentials
-wao.ui.form.authentication.forgottenPassword.recoverButton=3DRESET PASSWORD
+wao.ui.form.authentication.forgottenPassword.recoverButton=3DReset password
 wao.ui.form.authentication.forgottenPassword.title=3DReset your WAO's passwo=
rd
 wao.ui.form.authentication.title=3DWAO authentication
 wao.ui.form.boardingFrom=3DBoardings since
diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_fr_FR.properties
index 68f026d..18434ae 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
@@ -379,7 +379,7 @@ wao.ui.form.authentication.error.inactiveWaoUser=3DCe com=
pte est inactif, veuillez
 wao.ui.form.authentication.error.noRoleAttributed=3DAucun r=C3=B4le n'est at=
tribu=C3=A9 =C3=A0 ce compte, veuillez contacter un responsable
 wao.ui.form.authentication.error.userMustAcceptCgu=3DVous devez accepter les=
 conditions g=C3=A9n=C3=A9rales d'utilisation
 wao.ui.form.authentication.error.wrongCredentials=3DLes informations d'authe=
nfication ne sont pas correctes
-wao.ui.form.authentication.forgottenPassword.recoverButton=3DR=C3=89INITIALI=
SER
+wao.ui.form.authentication.forgottenPassword.recoverButton=3DDemander un nou=
veau mot de passe
 wao.ui.form.authentication.forgottenPassword.title=3DR=C3=A9cup=C3=A9ration =
de votre mot de passe WAO
 wao.ui.form.authentication.title=3DIdentification WAO
 wao.ui.form.boardingFrom=3DSollicitations du navire depuis le

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============8265240484792232984==--


From scm@users.codelutin.com Thu Apr  9 13:20:18 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  06/13: Pas besoin de surcharger input() juste pour
 appeller super, on =?utf-8?q?d=C3=A9finit?= les @Result en haut de l'action
 (comme dans le reste de l'appli), aucune raison d'avoir =?utf-8?q?=C3=A0?=
 catcher une NoRoleAttributedException =?utf-8?q?=C3=A0?= ce moment
Date: Thu, 09 Apr 2015 13:20:19 +0000
Message-ID: <20150409132017.EDAF95C4FB1@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2772326428208901280=="

--===============2772326428208901280==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit c23a182ef0a557bd07cf207e98021b57323ae354
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:18 2015 +0200

    Pas besoin de surcharger input() juste pour appeller super, on d=C3=A9fin=
it les @Result en haut de l'action (comme dans le reste de l'appli), aucune r=
aison d'avoir =C3=A0 catcher une NoRoleAttributedException =C3=A0 ce moment
---
 .../authentication/ForgottenPasswordAction.java      | 20 ++++++------------=
--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/F=
orgottenPasswordAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action=
/authentication/ForgottenPasswordAction.java
index e3cb2ec..ce49700 100644
--- a/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/Forgotte=
nPasswordAction.java
+++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/Forgotte=
nPasswordAction.java
@@ -1,16 +1,18 @@
 package fr.ifremer.wao.web.action.authentication;
=20
 import fr.ifremer.wao.services.service.administration.InactiveWaoUserExcepti=
on;
-import fr.ifremer.wao.services.service.administration.NoRoleAttributedExcept=
ion;
 import fr.ifremer.wao.services.service.administration.WaoUsersService;
 import fr.ifremer.wao.services.service.administration.WrongCredentialsExcept=
ion;
 import fr.ifremer.wao.web.WaoJspActionSupport;
-import org.apache.struts2.convention.annotation.Action;
 import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
=20
 /**
- * Created by davidcosse on 26/03/15.
+ * @since 5.1.2
  */
+@Results({
+        @Result(name=3D"success", type=3D"redirectAction", params =3D { "nam=
espace", "/authentication", "actionName",  "forgotten-password!input", "recov=
ered", "%{recovered}", "login", "%{login}"})
+})
 public class ForgottenPasswordAction extends WaoJspActionSupport {
=20
     private static final long serialVersionUID =3D 1L;
@@ -26,15 +28,8 @@ public class ForgottenPasswordAction extends WaoJspActionS=
upport {
     }
=20
     @Override
-    @Action("forgotten-password-input")
-    public String input() throws Exception {
-        return super.input();
-    }
+    public String execute() {
=20
-    @Override
-    @Action(results =3D {
-            @Result(name=3D"success", type=3D"redirectAction", params =3D { =
"namespace", "/authentication", "actionName",  "forgotten-password!input", "r=
ecovered", "%{recovered}", "login", "%{login}"})})
-    public String execute() throws Exception {
         try {
             service.askForPasswordReminder(login);
             recovered =3D true;
@@ -43,9 +38,6 @@ public class ForgottenPasswordAction extends WaoJspActionSu=
pport {
             addFieldError("login", t("wao.ui.form.authentication.error.wrong=
Credentials"));
             return INPUT;
         } catch (InactiveWaoUserException inactiveWaoUserException) {
-            addFieldError("login", t("wao.ui.form.authentication.error.noRol=
eAttributed"));
-            return INPUT;
-        } catch (NoRoleAttributedException noRoleAttributedException) {
             addFieldError("login", t("wao.ui.form.authentication.error.inact=
iveWaoUser"));
             return INPUT;
         }

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============2772326428208901280==--


From scm@users.codelutin.com Thu Apr  9 13:20:19 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  07/13: Ajout d'un test pour =?utf-8?q?v=C3=A9rifier?=
 le bon fonctionnement de la demande de renouvellement de mot de passe
Date: Thu, 09 Apr 2015 13:20:20 +0000
Message-ID: <20150409132018.47EA35C616F@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3354005783282046349=="

--===============3354005783282046349==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit d53a19e3e60fe54d76d42bcab82aeb98e3ce3f35
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:28 2015 +0200

    Ajout d'un test pour v=C3=A9rifier le bon fonctionnement de la demande de=
 renouvellement de mot de passe
---
 .../administration/WaoUsersServiceTest.java        | 44 ++++++++++++++++++++=
++
 1 file changed, 44 insertions(+)

diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/admin=
istration/WaoUsersServiceTest.java b/wao-services/src/test/java/fr/ifremer/wa=
o/services/service/administration/WaoUsersServiceTest.java
index e47d44d..6653feb 100644
--- a/wao-services/src/test/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersServiceTest.java
+++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersServiceTest.java
@@ -22,8 +22,10 @@ package fr.ifremer.wao.services.service.administration;
  */
=20
 import fr.ifremer.wao.services.AbstractWaoServiceTest;
+import fr.ifremer.wao.services.service.ObsMerFixtures;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
=20
@@ -33,11 +35,19 @@ public class WaoUsersServiceTest extends AbstractWaoServi=
ceTest {
=20
     protected WaoUsersService service;
=20
+    protected ObsMerFixtures fixtures;
+
+    protected boolean isDatabaseWithReferential() {
+        return true;
+    }
+
     @Before
     public void setUp() {
=20
         service =3D newService(WaoUsersService.class);
=20
+        fixtures =3D new ObsMerFixtures(newServiceContext());
+
     }
=20
     @Test
@@ -50,4 +60,38 @@ public class WaoUsersServiceTest extends AbstractWaoServic=
eTest {
         }
=20
     }
+
+    @Test
+    public void testAskForNewPassword() throws WrongCredentialsException, No=
RoleAttributedException, InactiveWaoUserException {
+
+        String login =3D fixtures.robert().getWaoUser().getLogin();
+        String fakePassword =3D fixtures.fakePassword();
+
+        service.authenticate(login, fakePassword);
+
+        try {
+            service.askForPasswordReminder(login);
+            service.authenticate(login, "BJlNoN1Q");
+        } catch (WrongCredentialsException | InactiveWaoUserException | NoRo=
leAttributedException e) {
+            if (log.isDebugEnabled()) {
+                log.debug("unexpected exception", e);
+            }
+            Assert.fail("unexpected exception" + e);
+        }
+
+        try {
+            service.authenticate(login, fakePassword);
+            Assert.fail("expected exception");
+        } catch (WrongCredentialsException e) {
+            if (log.isDebugEnabled()) {
+                log.debug("expected exception", e);
+            }
+        } catch (NoRoleAttributedException | InactiveWaoUserException e) {
+            if (log.isDebugEnabled()) {
+                log.debug("unexpected exception", e);
+            }
+            Assert.fail("unexpected exception" + e);
+        }
+
+    }
 }

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============3354005783282046349==--


From scm@users.codelutin.com Thu Apr  9 13:20:20 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  08/13: Remaniement de askForPasswordReminder pour 
 =?utf-8?q?r=C3=A9utiliser?= du code au sein de WaoUsersService
Date: Thu, 09 Apr 2015 13:20:21 +0000
Message-ID: <20150409132019.908B55C4FB1@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7819710159086743178=="

--===============7819710159086743178==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 229ead8e0b9204d01f0cba30584cb612d74649ae
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:12:53 2015 +0200

    Remaniement de askForPasswordReminder pour r=C3=A9utiliser du code au sei=
n de WaoUsersService
---
 .../src/main/java/fr/ifremer/wao/WaoUtils.java     |   5 +
 .../service/administration/WaoUsersService.java    | 109 ++++++++++---------=
--
 2 files changed, 56 insertions(+), 58 deletions(-)

diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java b/wao=
-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java
index 8f07aaf..0f4814e 100644
--- a/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java
+++ b/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.mutable.MutableInt;
 import org.apache.commons.lang3.time.DateUtils;
 import org.nuiton.i18n.I18n;
 import org.nuiton.util.DateUtil;
+import org.nuiton.util.StringUtil;
=20
 import java.text.DateFormat;
 import java.text.ParseException;
@@ -291,4 +292,8 @@ public class WaoUtils {
         }
         return keyWithHighestValue;
     }
+
+    public static String hashPassword(String password) {
+        return StringUtil.encodeMD5(password);
+    }
 }
diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/admin=
istration/WaoUsersService.java b/wao-services/src/main/java/fr/ifremer/wao/se=
rvices/service/administration/WaoUsersService.java
index 2e31b91..c9bea58 100644
--- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersService.java
+++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administrati=
on/WaoUsersService.java
@@ -25,6 +25,7 @@ import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
+import fr.ifremer.wao.WaoUtils;
 import fr.ifremer.wao.entity.Boat;
 import fr.ifremer.wao.entity.Boats;
 import fr.ifremer.wao.entity.ObsProgram;
@@ -44,7 +45,6 @@ import org.apache.commons.logging.LogFactory;
 import org.nuiton.topia.persistence.TopiaEntities;
 import org.nuiton.topia.persistence.TopiaEntity;
 import org.nuiton.topia.persistence.TopiaQueryBuilderAddCriteriaOrRunQuerySt=
ep;
-import org.nuiton.util.StringUtil;
=20
 import java.util.HashSet;
 import java.util.List;
@@ -183,17 +183,13 @@ public class WaoUsersService extends WaoServiceSupport {
         }
=20
         if (newPassword !=3D null) {
-            String hashedNewPassword =3D StringUtil.encodeMD5(newPassword);
+
+            String hashedNewPassword =3D WaoUtils.hashPassword(newPassword);
             waoUser.setPassword(hashedNewPassword);
         }
=20
         if (updateWaoUserCommand.getPasswordStrategy().isGeneratePassword())=
 {
-            UserCredentialsEmail userCredentialsEmail =3D
-                    getEmailService().newUserCredentialsEmail();
-            userCredentialsEmail.addTo(waoUser);
-            userCredentialsEmail.setWaoUser(waoUser);
-            userCredentialsEmail.setNewPassword(newPassword);
-            getEmailService().send(userCredentialsEmail);
+            sendNewPasswordToUser(waoUser, newPassword);
         }
=20
         if (waoUser.isUserProfileNotEmpty()) {
@@ -204,19 +200,26 @@ public class WaoUsersService extends WaoServiceSupport {
             }
         }
=20
-        WaoUserTopiaDao dao =3D getWaoUserDao();
-        if (waoUser.isPersisted()) {
-            dao.update(waoUser);
-        } else {
-            dao.create(waoUser);
-        }
+        getWaoUserDao().save(waoUser);
         commit();
=20
     }
=20
+    protected void sendNewPasswordToUser(WaoUser waoUser, String newPassword=
) {
+
+        UserCredentialsEmail userCredentialsEmail =3D
+                getEmailService().newUserCredentialsEmail();
+        userCredentialsEmail.addTo(waoUser);
+        userCredentialsEmail.setWaoUser(waoUser);
+        userCredentialsEmail.setNewPassword(newPassword);
+
+        getEmailService().send(userCredentialsEmail);
+
+    }
+
     protected String newRandomPassword() {
=20
-        return RandomStringUtils.random(8, true, true);
+        return RandomStringUtils.random(8, 0, 0, true, true, null, serviceCo=
ntext.getRandom());
=20
     }
=20
@@ -249,21 +252,9 @@ public class WaoUsersService extends WaoServiceSupport {
     public WaoUser authenticate(String login, String clearPassword)
             throws WrongCredentialsException, NoRoleAttributedException, Ina=
ctiveWaoUserException {
=20
-        WaoUserTopiaDao dao =3D getWaoUserDao();
-
-        Optional<WaoUser> optionalWaoUser =3D dao.tryFindByEmailAndFetchColl=
ections(login);
-
-        WaoUser waoUser;
-
-        if ( ! optionalWaoUser.isPresent()) {
-            if (log.isInfoEnabled()) {
-                log.info("no such user " + login);
-            }
-            throw new WrongCredentialsException();
-        }
+        WaoUser waoUser =3D findWaoUserByLogin(login, true);
=20
-        waoUser =3D optionalWaoUser.get();
-        String hashedPassword =3D StringUtil.encodeMD5(clearPassword);
+        String hashedPassword =3D WaoUtils.hashPassword(clearPassword);
=20
         if ( ! waoUser.getPassword().equals(hashedPassword)) {
             if (log.isWarnEnabled()) {
@@ -272,10 +263,6 @@ public class WaoUsersService extends WaoServiceSupport {
             throw new WrongCredentialsException();
         }
=20
-        if ( ! waoUser.isActive()) {
-            throw new InactiveWaoUserException(waoUser);
-        }
-
         if (waoUser.isUserProfileEmpty()) {
             throw new NoRoleAttributedException(waoUser);
         }
@@ -284,28 +271,16 @@ public class WaoUsersService extends WaoServiceSupport {
=20
     }
=20
-    public void acceptCgu(WaoUser waoUser) {
-
-        waoUser.setCguAccepted(serviceContext.getNow());
-
-        commit();
-
-    }
-
-    protected UpdateWaoUserCommand getPasswordRecoveryUpdateWaoUserCommand(W=
aoUser waoUser) {
-        UpdateWaoUserCommand updateWaoUserCommand =3D new UpdateWaoUserComma=
nd();
-        updateWaoUserCommand.setWaoUser(waoUser);
-        updateWaoUserCommand.setPasswordStrategy(UpdateWaoUserCommandPasswor=
dStrategy.GENERATE_NEW_PASSWORD);
-        updateWaoUserCommand.setPasswordStrategies(UpdateWaoUserCommandPassw=
ordStrategy.getPasswordStrategiesForWaoUserCreation());
-        return updateWaoUserCommand;
-    }
+    protected WaoUser findWaoUserByLogin(String login, boolean fetchDataForS=
ession) throws WrongCredentialsException, InactiveWaoUserException {
=20
-    public void askForPasswordReminder(String login) throws WrongCredentials=
Exception, InactiveWaoUserException, NoRoleAttributedException {
         WaoUserTopiaDao dao =3D getWaoUserDao();
=20
-        Optional<WaoUser> optionalWaoUser =3D dao.tryFindByEmailAndFetchColl=
ections(login);
-
-        WaoUser waoUser;
+        Optional<WaoUser> optionalWaoUser;
+        if (fetchDataForSession) {
+            optionalWaoUser =3D dao.tryFindByEmailAndFetchCollections(login);
+        } else {
+            optionalWaoUser =3D dao.forLoginEquals(login).tryFindUnique();
+        }
=20
         if ( ! optionalWaoUser.isPresent()) {
             if (log.isInfoEnabled()) {
@@ -314,18 +289,36 @@ public class WaoUsersService extends WaoServiceSupport {
             throw new WrongCredentialsException();
         }
=20
-        waoUser =3D optionalWaoUser.get();
+        WaoUser waoUser =3D optionalWaoUser.get();
=20
         if ( ! waoUser.isActive()) {
             throw new InactiveWaoUserException(waoUser);
         }
=20
-        if (waoUser.isUserProfileEmpty()) {
-            throw new NoRoleAttributedException(waoUser);
-        }
+        return waoUser;
+    }
=20
-        UpdateWaoUserCommand updateWaoUserCommand =3D getPasswordRecoveryUpd=
ateWaoUserCommand(waoUser);
+    public void acceptCgu(WaoUser waoUser) {
+
+        waoUser.setCguAccepted(serviceContext.getNow());
+
+        commit();
+
+    }
+
+    public void askForPasswordReminder(String login) throws WrongCredentials=
Exception, InactiveWaoUserException {
+
+        WaoUser waoUser =3D findWaoUserByLogin(login, false);
+
+        String newPassword =3D newRandomPassword();
+        String hashedNewPassword =3D WaoUtils.hashPassword(newPassword);
+        waoUser.setPassword(hashedNewPassword);
+
+        sendNewPasswordToUser(waoUser, newPassword);
+
+        getWaoUserDao().save(waoUser);
+        commit();
=20
-        save(updateWaoUserCommand);
     }
+
 }

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============7819710159086743178==--


From scm@users.codelutin.com Thu Apr  9 13:20:20 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits] 09/13: Ajout d'une valeur i18n manquante
Date: Thu, 09 Apr 2015 13:20:22 +0000
Message-ID: <20150409132020.529345C4719@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============9067765221116985053=="

--===============9067765221116985053==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 060144c9eb31e4d10a411585863b57568db81a88
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:16:55 2015 +0200

    Ajout d'une valeur i18n manquante
---
 wao-web/src/main/resources/i18n/wao-web_en_GB.properties | 2 +-
 wao-web/src/main/resources/i18n/wao-web_fr_FR.properties | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_en_GB.properties
index 53cd06c..1ed6cc8 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
@@ -532,7 +532,7 @@ wao.ui.page.waoUsers.titleForCompany=3DUsers for company =
%s
 wao.ui.periodToMustBeAfterPeriodFrom=3DThe end of the period must be after t=
he beginning
 wao.ui.publishedByProgram=3DPusblished by program
 wao.ui.publishedByYourCompany=3DPublished by company
-wao.ui.reminderSent=3D
+wao.ui.reminderSent=3DA new password has been sent, check out you inbox.
 wao.ui.removeBoatEligibility.confirm=3DAre you sure you want to make this bo=
at ineligible for sample row ?
 wao.ui.sampleRow.creation=3DCreation of a sample row
 wao.ui.sampleRow.edition=3DEdition of line %s
diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-w=
eb/src/main/resources/i18n/wao-web_fr_FR.properties
index 18434ae..f0bba41 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
@@ -533,7 +533,7 @@ wao.ui.page.waoUsers.titleForCompany=3DUtilisateurs de la=
 soci=C3=A9t=C3=A9 %s
 wao.ui.periodToMustBeAfterPeriodFrom=3DLa p=C3=A9riode de temps doit se term=
iner apr=C3=A8s avoir commenc=C3=A9
 wao.ui.publishedByProgram=3DPubli=C3=A9e par le programme
 wao.ui.publishedByYourCompany=3DPubli=C3=A9e par la soci=C3=A9t=C3=A9
-wao.ui.reminderSent=3DEmail de r=C3=A9cup=C3=A9ration du mot de passe envoy=
=C3=A9, consultez votre bo=C3=AEte mail
+wao.ui.reminderSent=3DEmail de r=C3=A9cup=C3=A9ration du mot de passe envoy=
=C3=A9, consultez votre bo=C3=AEte mail.
 wao.ui.removeBoatEligibility.confirm=3D=C3=8Ates-vous s=C3=BBr de vouloir re=
ndre le navire in=C3=A9ligible pour cette ligne ?
 wao.ui.sampleRow.creation=3DCr=C3=A9ation d'une ligne du plan d'=C3=A9chanti=
llonnage
 wao.ui.sampleRow.edition=3DModification de la ligne %s

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============9067765221116985053==--


From scm@users.codelutin.com Thu Apr  9 13:20:21 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits] 10/13: Suppression de code mort (?)
Date: Thu, 09 Apr 2015 13:20:23 +0000
Message-ID: <20150409132020.BB2845C510D@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1673130982756407305=="

--===============1673130982756407305==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 0afd3815f924c096f60ee24e84241b8be91b2023
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Tue Mar 31 12:21:30 2015 +0200

    Suppression de code mort (?)
---
 wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp=
 b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
index 3aeb73b..8a39c9e 100644
--- a/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
+++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/login.jsp
@@ -32,11 +32,6 @@
                 $('input[name=3D"login"]').focus();
             });
         </script>
-        <script type=3D"text/javascript">
-          function getLogin() {
-            return login =3D $('input[name=3D"login"]').val();
-          }
-        </script>
     </head>
     <body>
=20

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============1673130982756407305==--


From scm@users.codelutin.com Thu Apr  9 13:20:21 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits]  11/13: refs 6844 En cas de succes du renouvellement de
 mot de passe, redirection vers page de login. Si mot de passe =?utf-8?q?di?=
 =?utf-8?q?ff=C3=A9rent?= d'email alors redirection vers demande
 d'intervention sur site
Date: Thu, 09 Apr 2015 13:20:24 +0000
Message-ID: <20150409132021.26B6E5C616F@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7901423832661967477=="

--===============7901423832661967477==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop 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=C3=A9rent 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/F=
orgottenPasswordAction.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/Forgotte=
nPasswordAction.java
+++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/authentication/Forgotte=
nPasswordAction.java
@@ -4,14 +4,17 @@ import fr.ifremer.wao.services.service.administration.Inact=
iveWaoUserException;
 import fr.ifremer.wao.services.service.administration.WaoUsersService;
 import fr.ifremer.wao.services.service.administration.WrongCredentialsExcept=
ion;
 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;
=20
 /**
  * @since 5.1.2
  */
 @Results({
-        @Result(name=3D"success", type=3D"redirectAction", params =3D { "nam=
espace", "/authentication", "actionName",  "forgotten-password!input", "recov=
ered", "%{recovered}", "login", "%{login}"})
+        @Result(name=3D"success", type=3D"redirectAction", params =3D { "nam=
espace", "/authentication", "actionName",  "login!input", "login", "%{login}"=
}),
+        @Result(name=3D"none", type=3D"redirectAction", params =3D { "namesp=
ace", "/authentication", "actionName",  "forgotten-password!input", "failedNo=
tEmail", "%{failedNotEmail}"})
 })
 public class ForgottenPasswordAction extends WaoJspActionSupport {
=20
@@ -21,7 +24,7 @@ public class ForgottenPasswordAction extends WaoJspActionSu=
pport {
=20
     protected String login;
=20
-    protected boolean recovered;
+    protected boolean failedNotEmail;
=20
     public void setService(WaoUsersService service) {
         this.service =3D service;
@@ -30,10 +33,14 @@ public class ForgottenPasswordAction extends WaoJspAction=
Support {
     @Override
     public String execute() {
=20
+        if (StringUtils.isNotBlank(login) && ! StringUtil.isEmail(login) ) {
+            failedNotEmail =3D true;
+            return NONE;
+        }
+
         try {
             service.askForPasswordReminder(login);
-            recovered =3D true;
-            addActionMessage(t("wao.ui.reminderSent"));
+            session.addMessage(t("wao.ui.reminderSent"));
         } catch (WrongCredentialsException credentialException) {
             addFieldError("login", t("wao.ui.form.authentication.error.wrong=
Credentials"));
             return INPUT;
@@ -53,11 +60,11 @@ public class ForgottenPasswordAction extends WaoJspAction=
Support {
         return login;
     }
=20
-    public boolean isRecovered() {
-        return recovered;
+    public boolean isFailedNotEmail() {
+        return failedNotEmail;
     }
=20
-    public void setRecovered(boolean recovered) {
-        this.recovered =3D recovered;
+    public void setFailedNotEmail(boolean failedNotEmail) {
+        this.failedNotEmail =3D failedNotEmail;
     }
 }
diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-w=
eb/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=3DYou =
must accept the end-user
 wao.ui.form.authentication.error.wrongCredentials=3DIncorrect credentials
 wao.ui.form.authentication.forgottenPassword.recoverButton=3DReset password
 wao.ui.form.authentication.forgottenPassword.title=3DReset your WAO's passwo=
rd
+wao.ui.form.authentication.redirectToSIH=3DRequest to intervene on site
 wao.ui.form.authentication.title=3DWAO authentication
 wao.ui.form.boardingFrom=3DBoardings since
 wao.ui.form.boatName.placeholder=3DName of boat
@@ -511,6 +512,7 @@ wao.ui.misc.week=3DWeek
 wao.ui.misc.year=3DYear
 wao.ui.misc.yes=3DYes
 wao.ui.nContactsFound=3D%s contacts found
+wao.ui.needForIntervene=3DWe are not able the recover your password, please =
feel up a request for intervene on site.
 wao.ui.news.content=3DText
 wao.ui.news.title=3DTitle
 wao.ui.page.Administration.title=3DAdministration
diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-w=
eb/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=3DVous=
 devez accepter les condi
 wao.ui.form.authentication.error.wrongCredentials=3DLes informations d'authe=
nfication ne sont pas correctes
 wao.ui.form.authentication.forgottenPassword.recoverButton=3DDemander un nou=
veau mot de passe
 wao.ui.form.authentication.forgottenPassword.title=3DR=C3=A9cup=C3=A9ration =
de votre mot de passe WAO
+wao.ui.form.authentication.redirectToSIH=3DDemande d'intervention sur site
 wao.ui.form.authentication.title=3DIdentification WAO
 wao.ui.form.boardingFrom=3DSollicitations du navire depuis le
 wao.ui.form.boatName.placeholder=3DNom du bateau
@@ -512,6 +513,7 @@ wao.ui.misc.week=3DSemaine
 wao.ui.misc.year=3DAnn=C3=A9e
 wao.ui.misc.yes=3DOui
 wao.ui.nContactsFound=3D%s contacts trouv=C3=A9s
+wao.ui.needForIntervene=3DNous ne pouvons proc=C3=A9der au renouvellement de=
 votre mot de passe, merci de r=C3=A9diger une demande d=E2=80=99intervention=
 sur le site.
 wao.ui.news.content=3DTexte
 wao.ui.news.title=3DTitre
 wao.ui.page.Administration.title=3DAdministration
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/forgot=
ten-password.jsp
index 8fa421e..05c1401 100644
--- a/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-passwo=
rd.jsp
+++ b/wao-web/src/main/webapp/WEB-INF/content/authentication/forgotten-passwo=
rd.jsp
@@ -17,8 +17,8 @@
         <s:form action=3D"forgotten-password" namespace=3D"/authentication" =
method=3D"POST" cssClass=3D"form-horizontal">
=20
             <fieldset>
-                <s:if test=3D"recovered">
-                    <s:text name=3D"wao.ui.reminderSent"/>
+                <s:if test=3D"failedNotEmail">
+                    <s:text name=3D"wao.ui.needForIntervene"/>
                 </s:if>
                 <s:else>
                     <s:textfield name=3D"login"
@@ -27,12 +27,9 @@
             </fieldset>
=20
             <div class=3D"form-actions">
-                <s:if test=3D"recovered">
-                    <s:url namespace=3D"/authentication" action=3D"login!inp=
ut" id=3D"loginUrl">
-                        <s:param name=3D"login" value=3D"login" />
-                    </s:url>
-                    <s:a href=3D"%{loginUrl}" cssClass=3D"btn">
-                        <s:text name=3D"wao.ui.form.authentication.action.su=
bmit"/>
+                <s:if test=3D"failedNotEmail">
+                    <s:a href=3D"http://forms.ifremer.fr/sih/wao-demande-din=
tervention-sur-le-site/" cssClass=3D"btn">
+                        <s:text name=3D"wao.ui.form.authentication.redirectT=
oSIH"/>
                     </s:a>
                 </s:if>
                 <s:else>

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============7901423832661967477==--


From scm@users.codelutin.com Thu Apr  9 13:20:21 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits] 12/13: Refs #6844 : Syntaxical correction
Date: Thu, 09 Apr 2015 13:20:25 +0000
Message-ID: <20150409132021.65C885C4FB1@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6408257495458233797=="

--===============6408257495458233797==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 957035a31730ce279226408cbb3ce7165d816998
Author: L=C3=A9o Kaufmann <kaufmann@codelutin.com>
Date:   Thu Apr 9 15:07:55 2015 +0200

    Refs #6844 : Syntaxical correction
---
 wao-services/src/main/resources/email/UserCredentialsEmail_fr.mustache | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wao-services/src/main/resources/email/UserCredentialsEmail_fr.mu=
stache b/wao-services/src/main/resources/email/UserCredentialsEmail_fr.mustac=
he
index 191e487..e4f791b 100644
--- a/wao-services/src/main/resources/email/UserCredentialsEmail_fr.mustache
+++ b/wao-services/src/main/resources/email/UserCredentialsEmail_fr.mustache
@@ -1,6 +1,6 @@
 Bonjour {{waoUser.firstName}},
=20
-Vos identifiants de connexion ont chang=C3=A9s.
+Vos identifiants de connexion ont chang=C3=A9.
=20
 Votre identifiant : {{waoUser.login}}
=20

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============6408257495458233797==--


From scm@users.codelutin.com Thu Apr  9 13:20:22 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: wao-commits@list.forge.codelutin.com
Subject: [Wao-commits] 13/13: Fusion de la branche
 'feature/6844-forgotenPassword' dans develop (termine #6844)
Date: Thu, 09 Apr 2015 13:20:26 +0000
Message-ID: <20150409132021.B406D5C4719@goh.codelutin.com>
In-Reply-To: <20150409132013.25008.89479@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2907727414017508237=="

--===============2907727414017508237==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch develop in repository wao.

See http://git.codelutin.com/wao.git

commit 21521ad790eac9f04852feb30b01f96ba734237d
Merge: adcd234 957035a
Author: Brendan Le Ny <bleny@codelutin.com>
Date:   Thu Apr 9 15:18:55 2015 +0200

    Fusion de la branche 'feature/6844-forgotenPassword' dans develop (termin=
e #6844)

 .../java/fr/ifremer/wao/AbstractWaoTopiaDao.java   | 14 ++--
 .../src/main/java/fr/ifremer/wao/WaoUtils.java     |  5 ++
 .../service/administration/WaoUsersService.java    | 94 ++++++++++++++------=
--
 .../email/UserCredentialsEmail_fr.mustache         |  2 +-
 .../wao/services/service/ObsMerFixtures.java       |  4 +
 .../ifremer/wao/services/service/WaoFixtures.java  |  9 +++
 .../administration/WaoUsersServiceTest.java        | 44 ++++++++++
 .../java/fr/ifremer/wao/web/WaoInterceptor.java    |  5 +-
 .../authentication/ForgottenPasswordAction.java    | 70 ++++++++++++++++
 .../main/resources/i18n/wao-web_en_GB.properties   |  5 ++
 .../main/resources/i18n/wao-web_fr_FR.properties   |  5 ++
 .../content/authentication/forgotten-password.jsp  | 45 +++++++++++
 .../WEB-INF/content/authentication/login.jsp       | 18 +++--
 wao-web/src/main/webapp/WEB-INF/decorators.xml     |  1 +
 14 files changed, 276 insertions(+), 45 deletions(-)

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============2907727414017508237==--


