Created
March 21, 2011 19:09
-
-
Save felipe-prenholato/880008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: __init__.py | |
=================================================================== | |
--- __init__.py (revision 995) | |
+++ __init__.py (working copy) | |
@@ -89,10 +89,20 @@ | |
def search_s(self, base, scope, filterstr, attrlist): | |
cursor = self._cursor() | |
- results = cursor.connection.search_s(base, scope, filterstr.encode(self.charset), attrlist) | |
output = [] | |
- for dn, attrs in results: | |
- output.append((dn.decode(self.charset), attrs)) | |
+ search = cursor.connection.search(base, scope, filterstr.encode(self.charset), attrlist) | |
+ if type(search) is int: | |
+ while True: | |
+ dn,attrs = cursor.connection.result(search,2)[1][0] | |
+ if not dn: | |
+ break | |
+ output.append((dn.decode(self.charset), attrs)) | |
+ else: | |
+ results = search | |
+ for dn, attrs in results: | |
+ output.append((dn.decode(self.charset), attrs)) | |
+ | |
+ | |
return output | |
# FIXME: is this the right place to initialize the LDAP connection? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment