summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-05 13:53:01 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-05 13:53:01 +0100
commit582cd5f957ff99fa52fd7682b9ad9b9b8b9f816a (patch)
treef0d35d8df30ab6cb8ed7a22d1d72b7851f3f5037
parent9540f069b515e3ba6badd64414a47e93ceafa1dd (diff)
downloadpykolab-582cd5f957ff99fa52fd7682b9ad9b9b8b9f816a.tar.gz
Provide a _regular_search API call
-rw-r--r--pykolab/auth/ldap/__init__.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index a0d986a..fcb16c2 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -461,6 +461,40 @@ class LDAP(object):
):
pass
+ def _regular_search(self,
+ base_dn,
+ scope=ldap.SCOPE_SUBTREE,
+ filterstr="(objectClass=*)",
+ attrlist=None,
+ attrsonly=0,
+ timeout=-1,
+ callback=False,
+ primary_domain=None,
+ secondary_domains=[]
+ ):
+ self._connect()
+ self._bind()
+
+ _search = self.ldap.search(
+ base_dn,
+ scope=scope,
+ filterstr=filterstr,
+ attrlist=attrlist,
+ attrsonly=attrsonly
+ )
+
+ _results = []
+ _result_type = None
+
+ while not _result_type == ldap.RES_SEARCH_RESULT:
+ (_result_type, _result) = self.ldap.result(_search, False, 0)
+
+ if not _result == None:
+ for result in _result:
+ _results.append(result)
+
+ return _results
+
def _search(self,
base_dn,
scope=ldap.SCOPE_SUBTREE,
@@ -735,7 +769,7 @@ class LDAP(object):
domain_base_dn,
ldap.SCOPE_SUBTREE,
"(%s=%s)" %(domain_name_attribute,domain),
- override_search='_paged_search'
+ override_search='_regular_search'
)
domains = []