pykolab/auth

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Mon Aug 6 15:49:29 CEST 2012


 pykolab/auth/ldap/__init__.py |   28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

New commits:
commit 899566cc29dbeaabb48340494e108de5c9af8e2a
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Mon Aug 6 14:48:56 2012 +0100

    Fix entry_dn being referred to a little too early

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
 





More information about the commits mailing list