[portal-commits] JBoss Portal SVN: r11917 - in branches/JBoss_Portal_Branch_2_7/core-identity/src: main/org/jboss/portal/core/identity/ui/validators and 2 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Sep 17 11:19:13 EDT 2008


Author: mputz
Date: 2008-09-17 11:19:12 -0400 (Wed, 17 Sep 2008)
New Revision: 11917

Modified:
   branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
   branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
   branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
   branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/viewProfileInfo.xhtml
Log:
JBPORTAL-2167: Wrong validation message shown in Change password function

Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java	2008-09-17 13:34:57 UTC (rev 11916)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java	2008-09-17 15:19:12 UTC (rev 11917)
@@ -260,6 +260,7 @@
       ExternalContext ectx = ctx.getExternalContext();
       Map params = ectx.getRequestParameterMap();
       String action = (String) params.get("enableAction");
+      ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", ctx.getViewRoot().getLocale());
       this.currentUser = params.get("currentUser") != null ? decoder.encode((String) params.get("currentUser")) : null;
       
       if (this.currentUser != null && action != null)
@@ -285,12 +286,18 @@
          catch (Exception e)
          {
             log.error("unable to get user: " + this.currentUser, e);
-            ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", ctx.getViewRoot().getLocale());
             ctx.addMessage("status", new FacesMessage(bundle.getString("IDENTITY_MANAGEMENT_ERROR_ACTION_USER")));
             return "userAdmin";
          }
          // Updating search
-         ctx.addMessage("status", new FacesMessage("user enabled"));
+	 if (action.equals("enable"))
+         {
+            ctx.addMessage("status", new FacesMessage(bundle.getString("IDENTITY_MANAGEMENT_ENABLE_USER_ENABLED")));
+         }
+         else if (action.equals("disable"))
+         {
+            ctx.addMessage("status", new FacesMessage(bundle.getString("IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED")));
+         }		 
          // Update userList
          return this.searchUsers();
       }

Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java	2008-09-17 13:34:57 UTC (rev 11916)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java	2008-09-17 15:19:12 UTC (rev 11917)
@@ -45,7 +45,7 @@
       {
          String password = (String) ((HtmlInputSecret) passwordComponent).getValue();
 
-         if (value == null || password == null || !password.equals((String) value))
+         if (password != null && !password.equals((String) value))
          {
             throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
                   bundle.getString("IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH"),

Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties	2008-09-17 13:34:57 UTC (rev 11916)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties	2008-09-17 15:19:12 UTC (rev 11917)
@@ -116,7 +116,9 @@
 IDENTITY_MANAGEMENT_EDIT_ROLE=Edit role
 IDENTITY_MANAGEMENT_CREATE_ROLE=Create role
 IDENTITY_MANAGEMENT_DISABLE=Disable
+IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED=User disabled
 IDENTITY_MANAGEMENT_ENABLE=Enable
+IDENTITY_MANAGEMENT_ENABLE_USER_ENABLED=User enabled
 IDENTITY_MANAGEMENT_RESET_PASSWORD=Reset password
 IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER=Reset password for user 
 IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=The user will get a random password sent to his e-mail address.

Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/viewProfileInfo.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/viewProfileInfo.xhtml	2008-09-17 13:34:57 UTC (rev 11916)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/viewProfileInfo.xhtml	2008-09-17 15:19:12 UTC (rev 11917)
@@ -7,7 +7,7 @@
    class="identity-ui">
 
 	<f:loadBundle var="bundle" basename="conf.bundles.Identity" />
-	<h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+	<h:messages infoClass="portlet-msg-success" errorClass="portlet-msg-error"
 		fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
 
 	<h:panelGrid columns="2">




More information about the portal-commits mailing list