[Commits] (bcm) fix bug #2832: when updating user, password (and confirmation) only need to be

commits at osafoundation.org commits at osafoundation.org
Fri Apr 15 12:32:38 PDT 2005


Commit by: bcm
Modified files:
server/web/etc/MessageResources.properties 1.4 1.5
server/web/src/org/osaf/cosmo/ui/UserAction.java 1.6 1.7
server/web/web/WEB-INF/validation.xml 1.3 1.4
server/web/web/WEB-INF/jsp/user/view.jsp 1.4 1.5

Log message:
fix bug #2832: when updating user, password (and confirmation) only need to be
provided when changing the password.


Bugzilla links:
http://bugzilla.osafoundation.org/show_bug.cgi?id=2832

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/server/web/etc/MessageResources.properties.diff?r1=text&tr1=1.4&r2=text&tr2=1.5
http://cvs.osafoundation.org/index.cgi/server/web/src/org/osaf/cosmo/ui/UserAction.java.diff?r1=text&tr1=1.6&r2=text&tr2=1.7
http://cvs.osafoundation.org/index.cgi/server/web/web/WEB-INF/validation.xml.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/server/web/web/WEB-INF/jsp/user/view.jsp.diff?r1=text&tr1=1.4&r2=text&tr2=1.5

Index: server/web/web/WEB-INF/validation.xml
diff -u server/web/web/WEB-INF/validation.xml:1.3 server/web/web/WEB-INF/validation.xml:1.4
--- server/web/web/WEB-INF/validation.xml:1.3	Wed Apr 13 16:50:28 2005
+++ server/web/web/WEB-INF/validation.xml	Fri Apr 15 12:32:36 2005
@@ -102,8 +102,7 @@
          </var>
        </field>
        <field property="password"
-              depends="required,minlength,maxlength">
-         <msg name="required" key="Form.FieldRequired"/>
+              depends="minlength,maxlength">
          <msg name="minlength" key="Form.Length"/>
          <msg name="maxlength" key="Form.Length"/>
          <arg0 name="minlength" key="${var:minlength}" resource="false"/>
@@ -120,12 +119,11 @@
          </var>
        </field>
        <field property="confirm"
-              depends="required,validwhen">
-         <msg name="required" key="Form.FieldRequired"/>
+              depends="validwhen">
          <msg name="validwhen" key="User.Form.PasswordMismatch"/>
          <var>
            <var-name>test</var-name>
-           <var-value>(*this* == password)</var-value>
+           <var-value>((password == null) or (*this* == password))</var-value>
          </var>
        </field>
        <field property="role"

Index: server/web/src/org/osaf/cosmo/ui/UserAction.java
diff -u server/web/src/org/osaf/cosmo/ui/UserAction.java:1.6 server/web/src/org/osaf/cosmo/ui/UserAction.java:1.7
--- server/web/src/org/osaf/cosmo/ui/UserAction.java:1.6	Thu Apr 14 10:56:53 2005
+++ server/web/src/org/osaf/cosmo/ui/UserAction.java	Fri Apr 15 12:32:35 2005
@@ -246,7 +246,9 @@
             user.setUsername(form.getUsername());
         }
         user.setEmail(form.getEmail());
-        user.setPassword(form.getPassword());
+        if (form.getPassword() != null && ! form.getPassword().equals("")) {
+            user.setPassword(form.getPassword());
+        }
         String[] roleIds = form.getRole();
         HashMap idx = new HashMap();
         for (int i=0; i<roleIds.length; i++) {

Index: server/web/etc/MessageResources.properties
diff -u server/web/etc/MessageResources.properties:1.4 server/web/etc/MessageResources.properties:1.5
--- server/web/etc/MessageResources.properties:1.4	Mon Apr 11 15:19:57 2005
+++ server/web/etc/MessageResources.properties	Fri Apr 15 12:32:35 2005
@@ -68,6 +68,7 @@
 
 User.Form.Username=Username:
 User.Form.Email=Email:
+User.Form.PasswordBlurb=You only need to enter the password (and confirmation) if you are changing it.
 User.Form.Password=Password:
 User.Form.Confirm=Confirm Password:
 User.Form.Roles=Roles:

Index: server/web/web/WEB-INF/jsp/user/view.jsp
diff -u server/web/web/WEB-INF/jsp/user/view.jsp:1.4 server/web/web/WEB-INF/jsp/user/view.jsp:1.5
--- server/web/web/WEB-INF/jsp/user/view.jsp:1.4	Wed Apr 13 16:50:29 2005
+++ server/web/web/WEB-INF/jsp/user/view.jsp	Fri Apr 15 12:32:36 2005
@@ -35,6 +35,27 @@
     </tr>
     <tr>
       <td class="md" align="right">
+        <b><fmt:message key="User.Form.Roles"/></b>
+      </td>
+      <td class="md" align="left">
+        <c:forEach var="role" items="${Roles}">
+          <html:multibox property="role" value="${role.id}"
+                         styleClass="md"/>
+          ${role.name}<br/>
+        </c:forEach>
+        <cosmo:errmsg property="role"/>
+      </td>
+    </tr>
+    <tr>
+      <td class="md" align="right">
+        &nbsp;
+      </td>
+      <td class="md" align="left">
+        <span class="sm"><fmt:message key="User.Form.PasswordBlurb"/></span>
+      </td>
+    </tr>
+    <tr>
+      <td class="md" align="right">
         <b><fmt:message key="User.Form.Password"/></b>
       </td>
       <td class="md" align="left">
@@ -55,19 +76,6 @@
     </tr>
     <tr>
       <td class="md" align="right">
-        <b><fmt:message key="User.Form.Roles"/></b>
-      </td>
-      <td class="md" align="left">
-        <c:forEach var="role" items="${Roles}">
-          <html:multibox property="role" value="${role.id}"
-                         styleClass="md"/>
-          ${role.name}<br/>
-        </c:forEach>
-        <cosmo:errmsg property="role"/>
-      </td>
-    </tr>
-    <tr>
-      <td class="md" align="right">
         &nbsp;
       </td>
       <td class="md" align="left">



More information about the Commits mailing list