You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jw...@apache.org on 2005/01/14 16:22:05 UTC

svn commit: r125172 - /lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java

Author: jwkaltz
Date: Fri Jan 14 07:22:03 2005
New Revision: 125172

URL: http://svn.apache.org/viewcvs?view=rev&rev=125172
Log:
commented out superfluous sanity check, to avoid problems with MS Active
Directory

Modified:
   lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java

Modified: lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java?view=diff&rev=125172&p1=lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java&r1=125171&p2=lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java&r2=125172
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java	(original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/ldap/LDAPUser.java	Fri Jan 14 07:22:03 2005
@@ -452,15 +452,22 @@
 
 	    results = context.search(objectName, searchFilter, scope);
 
-	    if (results != null && results.hasMore()) {
-		result = (SearchResult)results.next();
+	    // sanity check: if more than one entry is returned
+	    // for a user-id, then the directory is probably flawed,
+	    // so it would be nice to warn the administrator.
+	    //
+	    // This block is commented out for now, because of possible
+	    // side-effects, such as unexpected exceptions.
+// 		try {
+// 		    if (results.hasMore()) {
+// 			log.warn("Found more than one entry in the directory for user " + userId + ". You probably should deactivate recursive searches. The first entry was used as a work-around.");
+// 		    }
+// 		}
+// 		catch (javax.naming.PartialResultException e) {
+// 		    if (log.isDebugEnabled())
+// 			log.debug("Catching and ignoring PartialResultException, as this means LDAP server does not support our sanity check");
+// 		}
 
-		// sanity check
-		if (results.hasMore()) {
-		    log.warn("Found more than one entry in the directory for user " + userId + ". You probably should deactivate recursive searches. The first entry was used as a work-around.");
-		}
-		
-	    }
 	}
         catch (NamingException e) {
 	    if (log.isDebugEnabled())

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org