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

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Nov 15 06:54:04 EST 2007


Author: emuckenhuber
Date: 2007-11-15 06:54:04 -0500 (Thu, 15 Nov 2007)
New Revision: 8941

Modified:
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/userInfo.xhtml
   branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
Log:
JBPORTAL-1732: escaping backslash for link parameter
JBPORTAL-1768: deleted unused variable


Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java	2007-11-15 11:54:04 UTC (rev 8941)
@@ -56,11 +56,8 @@
 
    public DynamicUserAttribute(String username)
    {
-      this.map = new HashMap();
+      this();
       this.username = username;
-      FacesContext ctx = FacesContext.getCurrentInstance();
-      this.identityUserBean = (IdentityUserBean) ctx.getApplication().createValueBinding(("#{identityusermgr}"))
-            .getValue(ctx);
    }
 
    public Class getType(Object propertyName) throws IllegalArgumentException

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java	2007-11-15 11:54:04 UTC (rev 8941)
@@ -51,9 +51,9 @@
    
    public String getUsername()
    {
-      return username;
+      return username;  
    }
-
+   
    public void setUsername(String username)
    {
       this.username = username;
@@ -73,4 +73,14 @@
    {
       return attribute;
    }
+   
+   /**
+    * Used for GET parameters - username does never contain a escape char
+    * 
+    * @return double escaped username
+    */
+   public String getEscapedUsername()
+   {
+      return username.replace("\\", "\\\\");
+   }
 }

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java	2007-11-15 11:54:04 UTC (rev 8941)
@@ -22,6 +22,8 @@
  ******************************************************************************/
 package org.jboss.portal.core.identity.ui;
 
+import org.jboss.portal.identity.Role;
+
 /**
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
@@ -37,6 +39,20 @@
 
    /** The role display name */
    private String displayName;
+   
+   public UIRole()
+   {
+      this.id = null;
+      this.name = null;
+      this.displayName = null;
+   }
+   
+   public UIRole(Role role)
+   {
+      this.id = role.getId();
+      this.name = role.getName();
+      this.displayName = role.getDisplayName();
+   }
 
    public String getDisplayName()
    {
@@ -62,4 +78,14 @@
    {
       this.name = name;
    }
+   
+   /**
+    * Used for GET parameters - role name does never contain a escape char
+    * 
+    * @return double escaped role
+    */
+   public String getEscapedName()
+   {
+      return name.replace("\\", "\\\\");
+   }
 }

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java	2007-11-15 11:54:04 UTC (rev 8941)
@@ -138,7 +138,7 @@
       Iterator i = set.iterator();
       while (i.hasNext())
       {
-         Role role = (Role) i.next();
+         UIRole role = new UIRole((Role) i.next());
          list.add(role);
       }
       this.roleList = new ListDataModel(list);

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml	2007-11-15 11:54:04 UTC (rev 8941)
@@ -64,11 +64,11 @@
 		</f:facet>
 		<h:commandLink action="#{editprofilemgr.adminEditProfile}" styleClass="actionRename">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE}"/>
-			<f:param name="currentUser" value="#{uiUser.username}"/>
+			<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 		</h:commandLink> | 
 		<h:commandLink action="#{assignrolemgr.assignRoles}" styleClass="actionPreferences">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_ROLES}"/>
-			<f:param name="currentUser" value="#{uiUser.username}"/>
+			<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 	    </h:commandLink>
 	</h:column>
 	</h:dataTable>

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml	2007-11-15 11:54:04 UTC (rev 8941)
@@ -38,15 +38,15 @@
 		</f:facet>
 		<h:commandLink action="#{editrolemgr.editRole}">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_EDIT_ROLE}" styleClass="actionRename"/>
-			<f:param name="currentRole" value="#{role.name}"/>
+			<f:param name="currentRole" value="#{role.escapedName}"/>
 		</h:commandLink>
 		| <h:commandLink action="#{rolemanagementbean.viewRoleMembers}" styleClass="actionPreferences">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE_MEMBERS}"/>
-			<f:param name="currentRole" value="#{role.name}"/>
+			<f:param name="currentRole" value="#{role.escapedName}"/>
 		  </h:commandLink>
 		| <h:commandLink action="#{rolemanagementbean.deleteRole}" styleClass="actionDelete">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_DELETE}"/>
-			<f:param name="currentRole" value="#{role.name}"/>
+			<f:param name="currentRole" value="#{role.escapedName}"/>
 		  </h:commandLink> 
 	</h:column>
 	</h:dataTable>

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml	2007-11-15 11:54:04 UTC (rev 8941)
@@ -74,20 +74,20 @@
 		</f:facet>
 		<h:commandLink action="#{editprofilemgr.adminEditProfile}" styleClass="actionRename">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE}"/>
-			<f:param name="currentUser" value="#{uiUser.username}"/>
+			<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 		</h:commandLink> | 
 		<h:commandLink action="#{assignrolemgr.assignRoles}" styleClass="actionProperties">
 			<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_ROLES}"/>
-			<f:param name="currentUser" value="#{uiUser.username}"/>
+			<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 	    </h:commandLink> | 
 		<h:commandLink action="#{useradministrationbean.enableUser}" styleClass="#{uiUser.attribute.enabled == true ? 'actionDefault' : 'actionMakeDefault'}">
 			<h:outputText value="#{uiUser.attribute.enabled == true ? bundle.IDENTITY_MANAGEMENT_DISABLE : bundle.IDENTITY_MANAGEMENT_ENABLE}" />
-			<f:param name="currentUser" value="#{uiUser.username}"/>
+			<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 			<f:param name="enableAction" value="#{uiUser.attribute.enabled == true ? 'disable' : 'enable'}" />
 		</h:commandLink> | 
 	    <h:commandLink action="#{useradministrationbean.deleteUser}" styleClass="actionDelete">
 	    	<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_DELETE}"/>
-	    	<f:param name="currentUser" value="#{uiUser.username}"/>
+	    	<f:param name="currentUser" value="#{uiUser.escapedUsername}"/>
 	    </h:commandLink>
 	</h:column>
 	</h:dataTable>

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/userInfo.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/userInfo.xhtml	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/userInfo.xhtml	2007-11-15 11:54:04 UTC (rev 8941)
@@ -50,7 +50,7 @@
 			  	<h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
 				<h:commandLink action="#{lostpasswordmgr.adminResetPassword}">
 					<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD}" />
-					<f:param name="currentUser" value="#{manager.uiUser.username}" />
+					<f:param name="currentUser" value="#{manager.uiUser.escapedUsername}" />
 				</h:commandLink> 
 				<h:panelGroup />
 			</c:when>
@@ -58,7 +58,7 @@
 			  	<h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
 				<h:commandLink action="#{manager.adminChangePassword}">
 					<h:outputText value="#{bundle.IDENTITY_EDIT_CHANGE_PASSWORD}" />
-					<f:param name="currentUser" value="#{manager.uiUser.username}" />
+					<f:param name="currentUser" value="#{manager.uiUser.escapedUsername}" />
 				</h:commandLink>
 				<h:panelGroup />						
 			</c:otherwise>
@@ -81,7 +81,7 @@
 		  	<h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
 			<h:commandLink action="changePassword">
 				<h:outputText value="#{bundle.IDENTITY_EDIT_CHANGE_PASSWORD}" />
-				<f:param name="currentUser" value="#{manager.uiUser.username}" />
+				<f:param name="currentUser" value="#{manager.uiUser.escapedUsername}" />
 			</h:commandLink>
 			<h:panelGroup />	
 	</c:otherwise>

Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml	2007-11-15 11:27:43 UTC (rev 8940)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml	2007-11-15 11:54:04 UTC (rev 8941)
@@ -16,7 +16,6 @@
 
 	<ui:decorate template="/WEB-INF/jsf/common/register.xhtml">
 		<ui:param name="manager" value="#{userregistermgr}"/>
-		<ui:param name="showCaptcha" value="true"/>
 	</ui:decorate>
 
 </ui:define>




More information about the portal-commits mailing list