Loading...

jetspeed-dev@portals.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

svn commit: r606255 - /portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/ldap/LdapPrincipalDaoImpl.java ate Wed Feb 20 00:01:32 2008

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]