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

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Sep 17 09:19:46 EDT 2008


Author: mputz
Date: 2008-09-17 09:19:46 -0400 (Wed, 17 Sep 2008)
New Revision: 11915

Modified:
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
Log:
JBPORTAL-2167: Wrong validation message shown in Change password function

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java	2008-09-17 12:29:20 UTC (rev 11914)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java	2008-09-17 13:19:46 UTC (rev 11915)
@@ -257,10 +257,12 @@
 
    public String enableUser()
    {
+	   
       FacesContext ctx = FacesContext.getCurrentInstance();
       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;
       
       // TODO - do something better than .equals("admin")
@@ -287,12 +289,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")));
+         }		 
          return this.searchUsers();
       }
       return "searchUsers";

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java	2008-09-17 12:29:20 UTC (rev 11914)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java	2008-09-17 13:19:46 UTC (rev 11915)
@@ -44,8 +44,7 @@
       if (passwordComponent != null && passwordComponent instanceof HtmlInputSecret)
       {
          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(bundle.getString("IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH")));
          }

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml	2008-09-17 12:29:20 UTC (rev 11914)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml	2008-09-17 13:19:46 UTC (rev 11915)
@@ -15,7 +15,7 @@
 </ui:define>
 
 <ui:define name="content">
-	<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