summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 14:48:56 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 14:49:25 +0100
commit9d77d0548f40b70da0d1ed16a5f362530234ed09 (patch)
treefda1bdbf17af5132827a42c107b6d80edbf29d44 /pykolab
parent3c890648406e656377a585e5c33f93f559e4372e (diff)
downloadpykolab-9d77d0548f40b70da0d1ed16a5f362530234ed09.tar.gz
Fix entry_dn being referred to a little too early
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 8c5a8e4..a7be76c 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -137,13 +137,16 @@ class LDAP(pykolab.base.Base):
login[3] preserves the originally specified realm.
"""
- log.debug(
- _("Attempting to authenticate user %s in realm %s") % (
- login,
- realm
- ),
- level=8
- )
+ try:
+ log.debug(
+ _("Attempting to authenticate user %s in realm %s") % (
+ login[0],
+ realm
+ ),
+ level=8
+ )
+ except:
+ pass
self.connect()
self._bind()
@@ -186,10 +189,13 @@ class LDAP(pykolab.base.Base):
self.ldap.simple_bind_s(entry_dn, login[1])
retval = True
except:
- log.debug(
- _("Failed to authenticate as user %s") % (entry_dn),
- level=8
- )
+ try:
+ log.debug(
+ _("Failed to authenticate as user %s") % (login[0]),
+ level=8
+ )
+ except:
+ pass
retval = False