Author: mputz
Date: 2008-10-09 10:23:21 -0400 (Thu, 09 Oct 2008)
New Revision: 12058
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/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_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2008-10-09
14:23:21 UTC (rev 12058)
@@ -278,12 +278,12 @@
catch (Exception e)
{
log.error("error while updating password", e);
- ctx.addMessage("status", new
FacesMessage(bundle.getString("IDENTITY_EDIT_CHANGE_PASSWORD_ERROR")));
+ ctx.addMessage("status", new
FacesMessage(FacesMessage.SEVERITY_ERROR,
bundle.getString("IDENTITY_EDIT_CHANGE_PASSWORD_ERROR"), ""));
}
}
else
{
- ctx.addMessage("status", new
FacesMessage(bundle.getString("IDENTITY_EDIT_CHANGE_PASSWORD_ERROR")));
+ ctx.addMessage("status", new FacesMessage(FacesMessage.SEVERITY_ERROR,
bundle.getString("IDENTITY_EDIT_CHANGE_PASSWORD_ERROR"), ""));
}
this.resetWindowState(ctx);
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2008-10-09
14:23:21 UTC (rev 12058)
@@ -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_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2008-10-09
14:23:21 UTC (rev 12058)
@@ -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_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2008-10-09
14:23:21 UTC (rev 12058)
@@ -54,8 +54,8 @@
IDENTITY_EDIT_PASSWORD_TITLE=Change your password
IDENTITY_EDIT_PASSWORD_CURRENT=Current password
IDENTITY_EDIT_CHANGE_PASSWORD=Change password
-IDENTITY_EDIT_CHANGE_PASSWORD_ERROR=Could not change your password.
-IDENTITY_EDIT_CHANGE_PASSWOR_STATUS=Your password has been updated.
+IDENTITY_EDIT_CHANGE_PASSWORD_ERROR=Could not change password.
+IDENTITY_EDIT_CHANGE_PASSWOR_STATUS=Password has been updated.
IDENTITY_EDIT_EMAIL_TITLE=Change your email address
IDENTITY_EDIT_EMAIL_NEW=New email address
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml 2008-10-09
14:23:21 UTC (rev 12058)
@@ -35,13 +35,13 @@
<h:inputSecret id="password" required="true"
value="#{editprofilemgr.password}">
<f:validateLength minimum="6"/>
</h:inputSecret>
- <h:message for="password"/>
+ <h:message for="password" infoClass="portlet-msg-success"
errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
warnClass="portlet-msg-alert"/>
<h:outputText value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
<h:inputSecret id="passwordCheck" required="true">
<f:validator validatorId="PasswordValidator"/>
</h:inputSecret>
- <h:message for="passwordCheck"/>
+ <h:message for="passwordCheck"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
</h:panelGrid>
<hr/>
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml 2008-10-09
14:23:21 UTC (rev 12058)
@@ -20,7 +20,9 @@
<ui:define name="content">
<h3><h:outputText
value="#{bundle.IDENTITY_MANAGEMENT_SEARCH_USER}"/></h3>
- <h:form>
+ <h:messages infoClass="portlet-msg-success"
errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error"
warnClass="portlet-msg-alert"/>
+ <h:form>
<h:panelGrid columns="4">
<h:inputText id="searchString"
value="#{useradministrationbean.searchString}" />
<h:commandButton id ="search"
value="#{bundle.IDENTITY_MANAGEMENT_SEARCH_USER}"
action="#{useradministrationbean.searchUsers}"
styleClass="portlet-form-button"/>
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
===================================================================
---
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2008-10-09
02:02:07 UTC (rev 12057)
+++
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2008-10-09
14:23:21 UTC (rev 12058)
@@ -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">