From echatellier@users.nuiton.org Wed Oct 24 17:05:54 2012
From: echatellier@users.nuiton.org
To: nuiton-web-commits@list.nuiton.org
Subject: [Nuiton-web-commits] r230 - in trunk/nuiton-security/src/main:
	java/org/nuiton/web/security java/org/nuiton/web/security/actions
	resources/WEB-INF/security resources/i18n
Date: Wed, 24 Oct 2012 17:05:54 +0200
Message-ID: <20121024150554.05BD4159C4@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4952702125037569453=="

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

Author: echatellier
Date: 2012-10-24 17:05:53 +0200 (Wed, 24 Oct 2012)
New Revision: 230

Url: http://nuiton.org/repositories/revision/nuiton-web/230

Log:
Encode password using md5 hash
Add user and role delete action

Modified:
   trunk/nuiton-security/src/main/java/org/nuiton/web/security/SecurityShiroF=
ilter.java
   trunk/nuiton-security/src/main/java/org/nuiton/web/security/TopiaSecurityR=
ealm.java
   trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/RoleAc=
tion.java
   trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/UserAc=
tion.java
   trunk/nuiton-security/src/main/resources/WEB-INF/security/login.jsp
   trunk/nuiton-security/src/main/resources/WEB-INF/security/role-permissions=
.jsp
   trunk/nuiton-security/src/main/resources/WEB-INF/security/role.jsp
   trunk/nuiton-security/src/main/resources/WEB-INF/security/user-roles.jsp
   trunk/nuiton-security/src/main/resources/WEB-INF/security/user.jsp
   trunk/nuiton-security/src/main/resources/i18n/nuiton-security_en_GB.proper=
ties
   trunk/nuiton-security/src/main/resources/i18n/nuiton-security_fr_FR.proper=
ties

Modified: trunk/nuiton-security/src/main/java/org/nuiton/web/security/Securit=
yShiroFilter.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/java/org/nuiton/web/security/SecurityShiro=
Filter.java	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/java/org/nuiton/web/security/SecurityShiro=
Filter.java	2012-10-24 15:05:53 UTC (rev 230)
@@ -59,7 +59,7 @@
=20
     public static final String ROOT_CONTEXT_CONTEXT =3D SecurityShiroFilter.=
class.getName() + "#" + TopiaContext.class.getName();
=20
-    protected static final String ANON_LOGIN =3D "anonymous";
+    public static final String ANON_LOGIN =3D "anonymous";
    =20
     public static final String SESSION_SAVED_URL =3D "savedUrl";
=20

Modified: trunk/nuiton-security/src/main/java/org/nuiton/web/security/TopiaSe=
curityRealm.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/java/org/nuiton/web/security/TopiaSecurity=
Realm.java	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/java/org/nuiton/web/security/TopiaSecurity=
Realm.java	2012-10-24 15:05:53 UTC (rev 230)
@@ -34,6 +34,7 @@
 import org.apache.shiro.authc.AuthenticationToken;
 import org.apache.shiro.authc.SimpleAuthenticationInfo;
 import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.authc.credential.CredentialsMatcher;
 import org.apache.shiro.authz.AuthorizationInfo;
 import org.apache.shiro.authz.SimpleAuthorizationInfo;
 import org.apache.shiro.realm.AuthorizingRealm;
@@ -42,9 +43,10 @@
 import org.nuiton.topia.TopiaException;
 import org.nuiton.topia.TopiaRuntimeException;
 import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.StringUtil;
 import org.nuiton.web.SecurityDAOHelper;
=20
-public class TopiaSecurityRealm extends AuthorizingRealm {
+public class TopiaSecurityRealm extends AuthorizingRealm implements Credenti=
alsMatcher {
=20
     private static final Log log =3D LogFactory.getLog(TopiaSecurityRealm.cl=
ass);
=20
@@ -55,9 +57,21 @@
     public TopiaSecurityRealm(TopiaContext rootContext, ApplicationConfig co=
nfig) {
         this.rootContext =3D rootContext;
         this.config =3D config;
+       =20
+        setCredentialsMatcher(this);
     }
=20
     @Override
+    public boolean doCredentialsMatch(AuthenticationToken token, Authenticat=
ionInfo info) {
+        char[] tokenCredentials =3D (char[]) token.getCredentials();
+        String submittedPassword =3D String.valueOf(tokenCredentials);
+        String submittedHashedPassword =3D StringUtil.encodeMD5(submittedPas=
sword);
+
+        String expectedHashedPassword =3D (String) info.getCredentials();
+        return expectedHashedPassword.equals(submittedHashedPassword);
+    }
+
+    @Override
     protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection p=
rincipals) {
=20
         SimpleAuthorizationInfo result =3D null;
@@ -162,7 +176,7 @@
             if (securityUser !=3D null) {
                 if (login.equals(SecurityShiroFilter.ANON_LOGIN)) {
                     result =3D new SimpleAuthenticationInfo(securityUser.get=
Login(),
-                        "", getName());
+                        StringUtil.encodeMD5(""), getName());
                 } else {
                     result =3D new SimpleAuthenticationInfo(securityUser.get=
Login(),
                         securityUser.getPassword(), getName());

Modified: trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions=
/RoleAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/RoleA=
ction.java	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/RoleA=
ction.java	2012-10-24 15:05:53 UTC (rev 230)
@@ -26,6 +26,8 @@
 package org.nuiton.web.security.actions;
=20
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.nuiton.topia.TopiaContext;
 import org.nuiton.topia.TopiaException;
 import org.nuiton.topia.TopiaRuntimeException;
@@ -39,6 +41,8 @@
     /** serialVersionUID. */
     private static final long serialVersionUID =3D 1L;
=20
+    private static final Log log =3D LogFactory.getLog(RoleAction.class);
+
     protected SecurityRoleDAO securityRoleDAO;
=20
     protected SecurityRole role;
@@ -48,7 +52,10 @@
             String roleId =3D getParameter("roleId");
             if (StringUtils.isNotBlank(roleId)) {
                 try {
+                    TopiaContext transaction =3D rootContext.beginTransactio=
n();
+                    securityRoleDAO =3D SecurityDAOHelper.getSecurityRoleDAO=
(transaction);
                     role =3D securityRoleDAO.findByTopiaId(roleId);
+                    transaction.closeContext();
                 } catch (TopiaException ex) {
                     throw new TopiaRuntimeException(ex);
                 }
@@ -59,6 +66,27 @@
         return role;
     }
=20
+    public String delete() throws Exception {
+        try {
+            String roleId =3D getParameter("roleId");
+            if (StringUtils.isNotBlank(roleId)) {
+                TopiaContext transaction =3D rootContext.beginTransaction();
+                securityRoleDAO =3D SecurityDAOHelper.getSecurityRoleDAO(tra=
nsaction);
+                SecurityRole role =3D securityRoleDAO.findByTopiaId(roleId);
+                securityRoleDAO.delete(role);
+                transaction.commitTransaction();
+                transaction.closeContext();
+            }
+           =20
+        } catch (Exception ex) {
+            if (log.isErrorEnabled()) {
+                log.error("Can't delete role", ex);
+            }
+        }
+
+        return SUCCESS;
+    }
+
     @Override
     public String execute() throws Exception {
         String result =3D super.execute();
@@ -66,10 +94,10 @@
         try {
             TopiaContext transaction =3D rootContext.beginTransaction();
             securityRoleDAO =3D SecurityDAOHelper.getSecurityRoleDAO(transac=
tion);
-            if (role.getTopiaId() =3D=3D null) {
-                securityRoleDAO.create(role);
+            if (getRole().getTopiaId() =3D=3D null) {
+                securityRoleDAO.create(getRole());
             } else {
-                securityRoleDAO.update(role);
+                securityRoleDAO.update(getRole());
             }
             transaction.commitTransaction();
             transaction.closeContext();

Modified: trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions=
/UserAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/UserA=
ction.java	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/java/org/nuiton/web/security/actions/UserA=
ction.java	2012-10-24 15:05:53 UTC (rev 230)
@@ -24,10 +24,14 @@
=20
 package org.nuiton.web.security.actions;
=20
+import static org.nuiton.i18n.I18n._;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.nuiton.topia.TopiaContext;
 import org.nuiton.topia.TopiaException;
 import org.nuiton.topia.TopiaRuntimeException;
+import org.nuiton.util.StringUtil;
 import org.nuiton.web.SecurityDAOHelper;
 import org.nuiton.web.security.SecurityUser;
 import org.nuiton.web.security.SecurityUserDAO;
@@ -38,16 +42,25 @@
     /** serialVersionUID. */
     private static final long serialVersionUID =3D 1L;
=20
+    private static final Log log =3D LogFactory.getLog(UserAction.class);
+
     protected SecurityUserDAO securityUserDAO;
=20
     protected SecurityUser user;
=20
+    protected String password;
+
+    protected String confirm;
+
     public SecurityUser getUser() {
         if (user =3D=3D null) {
             String roleId =3D getParameter("userId");
             if (StringUtils.isNotBlank(roleId)) {
                 try {
+                    TopiaContext transaction =3D rootContext.beginTransactio=
n();
+                    securityUserDAO =3D SecurityDAOHelper.getSecurityUserDAO=
(transaction);
                     user =3D securityUserDAO.findByTopiaId(roleId);
+                    transaction.closeContext();
                 } catch (TopiaException ex) {
                     throw new TopiaRuntimeException(ex);
                 }
@@ -58,13 +71,56 @@
         return user;
     }
=20
+    public void setPassword(String password) {
+        this.password =3D password;
+    }
+
+    public void setConfirm(String confirm) {
+        this.confirm =3D confirm;
+    }
+
+    public String delete() throws Exception {
+        try {
+            String roleId =3D getParameter("userId");
+            if (StringUtils.isNotBlank(roleId)) {
+                TopiaContext transaction =3D rootContext.beginTransaction();
+                securityUserDAO =3D SecurityDAOHelper.getSecurityUserDAO(tra=
nsaction);
+                SecurityUser user =3D securityUserDAO.findByTopiaId(roleId);
+                securityUserDAO.delete(user);
+                transaction.commitTransaction();
+                transaction.closeContext();
+            }
+        } catch (Exception ex) {
+            if (log.isErrorEnabled()) {
+                log.error("Can't delete user", ex);
+            }
+        }
+
+        return SUCCESS;
+    }
+
     @Override
+    public void validate() {
+        if (StringUtils.isNotBlank(password)) {
+            if (!password.equals(confirm)) {
+                addActionError(_("Les mots de passes ne sont pas identiques =
!"));
+            }
+        }
+    }
+
+    @Override
     public String execute() throws Exception {
         String result =3D super.execute();
=20
         try {
             TopiaContext transaction =3D rootContext.beginTransaction();
             securityUserDAO =3D SecurityDAOHelper.getSecurityUserDAO(transac=
tion);
+           =20
+            SecurityUser user =3D getUser();
+            if (StringUtils.isNotBlank(password)) {
+                String md5Password =3D StringUtil.encodeMD5(password);
+                user.setPassword(md5Password);
+            }
             if (user.getTopiaId() =3D=3D null) {
                 securityUserDAO.create(user);
             } else {

Modified: trunk/nuiton-security/src/main/resources/WEB-INF/security/login.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/WEB-INF/security/login.jsp	2012-=
10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/WEB-INF/security/login.jsp	2012-=
10-24 15:05:53 UTC (rev 230)
@@ -1,24 +1,12 @@
 <%--
   #%L
-  Nuiton Web :: Nuiton Security
+  SGQ :: Web
   $Id:$
   $HeadURL:$
   %%
-  Copyright (C) 2012 CodeLutin, Chatellier Eric
+  Copyright (C) 2012 Herboristerie Cailleau
   %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as=20
-  published by the Free Software Foundation, either version 3 of the=20
-  License, or (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Lesser Public License for more details.
- =20
-  You should have received a copy of the GNU General Lesser Public=20
-  License along with this program.  If not, see
-  <http://www.gnu.org/licenses/lgpl-3.0.html>.
+  Herboristerie Cailleau - Tous droits r=C3=A9serv=C3=A9s
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>

Modified: trunk/nuiton-security/src/main/resources/WEB-INF/security/role-perm=
issions.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/WEB-INF/security/role-permission=
s.jsp	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/WEB-INF/security/role-permission=
s.jsp	2012-10-24 15:05:53 UTC (rev 230)
@@ -1,24 +1,12 @@
 <%--
   #%L
-  Nuiton Web :: Nuiton Security
+  SGQ :: Web
   $Id:$
   $HeadURL:$
   %%
-  Copyright (C) 2012 CodeLutin, Chatellier Eric
+  Copyright (C) 2012 Herboristerie Cailleau
   %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as=20
-  published by the Free Software Foundation, either version 3 of the=20
-  License, or (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Lesser Public License for more details.
- =20
-  You should have received a copy of the GNU General Lesser Public=20
-  License along with this program.  If not, see
-  <http://www.gnu.org/licenses/lgpl-3.0.html>.
+  Herboristerie Cailleau - Tous droits r=C3=A9serv=C3=A9s
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>

Modified: trunk/nuiton-security/src/main/resources/WEB-INF/security/role.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/WEB-INF/security/role.jsp	2012-1=
0-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/WEB-INF/security/role.jsp	2012-1=
0-24 15:05:53 UTC (rev 230)
@@ -1,24 +1,12 @@
 <%--
   #%L
-  Nuiton Web :: Nuiton Security
+  SGQ :: Web
   $Id:$
   $HeadURL:$
   %%
-  Copyright (C) 2012 CodeLutin, Chatellier Eric
+  Copyright (C) 2012 Herboristerie Cailleau
   %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as=20
-  published by the Free Software Foundation, either version 3 of the=20
-  License, or (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Lesser Public License for more details.
- =20
-  You should have received a copy of the GNU General Lesser Public=20
-  License along with this program.  If not, see
-  <http://www.gnu.org/licenses/lgpl-3.0.html>.
+  Herboristerie Cailleau - Tous droits r=C3=A9serv=C3=A9s
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>
@@ -33,14 +21,14 @@
=20
   <div class=3D"security-div">
     <h1>S=C3=A9curit=C3=A9</h1>
-
-    <s:if test=3D'%{product.topiaId !=3D null}'>
-      <h2>Nouveau r&ocirc;le</h2>
+   =20
+    <s:if test=3D'%{role.topiaId !=3D null}'>
+      <h2>Modification d'un r&ocirc;le</h2>
     </s:if>
     <s:else>
-      <h2>Modification d'un r&ocirc;le</h2>
+      <h2>Nouveau r&ocirc;le</h2>
     </s:else>
- =20
+
     <s:form action=3D"role" namespace=3D"/security" class=3D"security-form">
       <s:actionerror />
       <s:hidden name=3D"roleId" value=3D"%{role.topiaId}" />
@@ -49,5 +37,12 @@
     </s:form>
   </div>
=20
+  <s:if test=3D'%{role.topiaId !=3D null}'>
+    <s:a action=3D"role!delete" namespace=3D"/security" class=3D"delete">
+      <s:param name=3D"roleId"><s:property value=3D"role.topiaId" /></s:para=
m>
+      Supprimer
+    </s:a>
+  </s:if>
+
  </body>
 </html>
\ No newline at end of file

Modified: trunk/nuiton-security/src/main/resources/WEB-INF/security/user-role=
s.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/WEB-INF/security/user-roles.jsp	=
2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/WEB-INF/security/user-roles.jsp	=
2012-10-24 15:05:53 UTC (rev 230)
@@ -1,24 +1,12 @@
 <%--
   #%L
-  Nuiton Web :: Nuiton Security
+  SGQ :: Web
   $Id:$
   $HeadURL:$
   %%
-  Copyright (C) 2012 CodeLutin, Chatellier Eric
+  Copyright (C) 2012 Herboristerie Cailleau
   %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as=20
-  published by the Free Software Foundation, either version 3 of the=20
-  License, or (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Lesser Public License for more details.
- =20
-  You should have received a copy of the GNU General Lesser Public=20
-  License along with this program.  If not, see
-  <http://www.gnu.org/licenses/lgpl-3.0.html>.
+  Herboristerie Cailleau - Tous droits r=C3=A9serv=C3=A9s
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>
@@ -63,11 +51,16 @@
               <th rowspan=3D"<s:property value=3D"users.size()" />" class=3D=
"vertical">Utilisateurs</th>
             </s:if>
             <td>
-              <a href=3D"<s:url action=3D'user!input' namespace=3D'/security=
'>
-                <s:param name=3D"userId"><s:property value=3D"topiaId" /></s=
:param>
-              </s:url>">
+              <s:if test=3D"login =3D=3D @org.nuiton.web.security.SecuritySh=
iroFilter@ANON_LOGIN">
                 <s:property value=3D"login" />
-              </a>
+              </s:if>
+              <s:else>
+                <a href=3D"<s:url action=3D'user!input' namespace=3D'/securi=
ty'>
+                  <s:param name=3D"userId"><s:property value=3D"topiaId" /><=
/s:param>
+                </s:url>">
+                  <s:property value=3D"login" />
+                </a>
+              </s:else>
             </td>
             <s:iterator value=3D"roles" var=3D"role">
               <td>

Modified: trunk/nuiton-security/src/main/resources/WEB-INF/security/user.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/WEB-INF/security/user.jsp	2012-1=
0-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/WEB-INF/security/user.jsp	2012-1=
0-24 15:05:53 UTC (rev 230)
@@ -1,24 +1,12 @@
 <%--
   #%L
-  Nuiton Web :: Nuiton Security
+  SGQ :: Web
   $Id:$
   $HeadURL:$
   %%
-  Copyright (C) 2012 CodeLutin, Chatellier Eric
+  Copyright (C) 2012 Herboristerie Cailleau
   %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as=20
-  published by the Free Software Foundation, either version 3 of the=20
-  License, or (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Lesser Public License for more details.
- =20
-  You should have received a copy of the GNU General Lesser Public=20
-  License along with this program.  If not, see
-  <http://www.gnu.org/licenses/lgpl-3.0.html>.
+  Herboristerie Cailleau - Tous droits r=C3=A9serv=C3=A9s
   #L%
   --%>
 <%@ page language=3D"java" contentType=3D"text/html; charset=3Dutf-8" pageEn=
coding=3D"utf-8"%>
@@ -26,7 +14,7 @@
 <%@taglib uri=3D"/struts-tags" prefix=3D"s" %>
 <html xmlns=3D"http://www.w3.org/1999/xhtml">
  <head>
-  <title>Secu</title>
+  <title>S=C3=A9curit=C3=A9</title>
  </head>
=20
  <body>
@@ -34,14 +22,28 @@
   <div class=3D"security-div">
     <h1>S=C3=A9curit=C3=A9</h1>
=20
-    <h2>Nouvel utilisateur</h2>
+    <s:if test=3D'%{role.topiaId !=3D null}'>
+      <h2>Modification d'un utilisateur</h2>
+    </s:if>
+    <s:else>
+      <h2>Nouveau utilisateur</h2>
+    </s:else>
+
     <s:form action=3D"user" namespace=3D"/security" class=3D"security-form">
       <s:actionerror />
       <s:hidden name=3D"userId" value=3D"%{user.topiaId}" />
       <s:textfield label=3D"Identifiant" name=3D"user.login" value=3D"%{user=
.login}"/>
-      <s:password label=3D"Mot de passe" name=3D"user.password" value=3D"%{u=
ser.password}" />
+      <s:password label=3D"Mot de passe" name=3D"password" />
+      <s:password label=3D"Confirmation" name=3D"confirm" />
       <s:submit label=3D"Valider" />
     </s:form>
+   =20
+    <s:if test=3D'%{user.topiaId !=3D null}'>
+      <s:a action=3D"user!delete" namespace=3D"/security" class=3D"delete">
+        <s:param name=3D"userId"><s:property value=3D"user.topiaId" /></s:pa=
ram>
+        Supprimer
+      </s:a>
+    </s:if>
   </div>
  </body>
 </html>
\ No newline at end of file

Modified: trunk/nuiton-security/src/main/resources/i18n/nuiton-security_en_GB=
.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/i18n/nuiton-security_en_GB.prope=
rties	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/i18n/nuiton-security_en_GB.prope=
rties	2012-10-24 15:05:53 UTC (rev 230)
@@ -1,3 +1,4 @@
 Compte\ bloqu=C3=A9.\ Contacter\ un\ administrateur=3D
 Identifiant\ ou\ mot\ de\ passe\ invalide\ \!=3D
+Les\ mots\ de\ passes\ ne\ sont\ pas\ identiques\ \!=3D
 Nombre\ de\ tentatives\ d=C3=A9pass=C3=A9=3D

Modified: trunk/nuiton-security/src/main/resources/i18n/nuiton-security_fr_FR=
.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nuiton-security/src/main/resources/i18n/nuiton-security_fr_FR.prope=
rties	2012-10-24 12:43:58 UTC (rev 229)
+++ trunk/nuiton-security/src/main/resources/i18n/nuiton-security_fr_FR.prope=
rties	2012-10-24 15:05:53 UTC (rev 230)
@@ -1,3 +1,4 @@
 Compte\ bloqu=C3=A9.\ Contacter\ un\ administrateur=3D
 Identifiant\ ou\ mot\ de\ passe\ invalide\ \!=3D
+Les\ mots\ de\ passes\ ne\ sont\ pas\ identiques\ \!=3D
 Nombre\ de\ tentatives\ d=C3=A9pass=C3=A9=3D


--===============4952702125037569453==--


