summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-26 15:56:41 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-26 15:56:41 +0100
commit582edb976ea0e6d3489cc9852347f278d51a1c68 (patch)
treefa586073a78665e75556a4460d7cdff58f78e462
parent70681e3d0c10b5fa9f043cbc62ea56eb645ab313 (diff)
downloadpykolab-582edb976ea0e6d3489cc9852347f278d51a1c68.tar.gz
Make sure that the function of entry_dn uses the correct base_dn
-rw-r--r--pykolab/auth/ldap/__init__.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index bf75489..2f7d49c 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -305,7 +305,13 @@ class LDAP(pykolab.base.Base):
return entry_id['dn']
unique_attribute = self.config_get('unique_attribute')
- base_dn = self.config_get('base_dn')
+ config_base_dn = self.config_get('base_dn')
+ ldap_base_dn = self._kolab_domain_root_dn(self.domain)
+
+ if not ldap_base_dn == None and not ldap_base_dn == config_base_dn:
+ base_dn = ldap_base_dn
+ else:
+ base_dn = config_base_dn
_search = self.ldap.search_ext(
base_dn,
@@ -349,9 +355,18 @@ class LDAP(pykolab.base.Base):
self._bind()
- #print entry_id
+ log.debug(_("Entry ID: %r") % (entry_id), level=9)
entry_dn = self.entry_dn(entry_id)
- #print entry_dn
+ log.debug(_("Entry DN: %r") % (entry_dn), level=9)
+
+ log.debug(
+ _("ldap search: (%r, %r, filterstr='(objectclass=*)', attrlist=[ 'dn' ] + %r") % (
+ entry_dn,
+ ldap.SCOPE_BASE,
+ attributes
+ ),
+ level=9
+ )
_search = self.ldap.search_ext(
entry_dn,