You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2007/12/21 18:17:04 UTC

svn commit: r606255 - /portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java

Author: ate
Date: Fri Dec 21 09:17:03 2007
New Revision: 606255

URL: http://svn.apache.org/viewvc?rev=606255&view=rev
Log:
Fix for JS2-837: Attributes template for initial LDAP user/role/group attributes does not accept '=' sign
Patch provided by Dennis Dam

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java?rev=606255&r1=606254&r2=606255&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java (original)
+++ portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java Fri Dec 21 09:17:03 2007
@@ -312,8 +312,16 @@
 	}
 
 	protected String[] parseAttr(String attr, String replace) {
-		attr = StringUtils.replace(attr, "{u}", replace);
-		return StringUtils.split(attr,"=");
+        attr = StringUtils.replace(attr, "{u}", replace);
+        int index = attr.indexOf('=');
+        
+        if (index != -1){
+            return new String[]{ 
+                    attr.substring(0,index), 
+                    index < attr.length() -1 ? attr.substring(index + 1) : null}; 
+        } else {
+            return new String[]{ attr, null }; 
+        }
 	}
 
 	protected String getGroupDN(String groupPrincipalUid) {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org