server/sources/ldapuser.py
branchstable
changeset 5856 a02129508378
parent 5855 db59080f1c8d
child 5972 220856aff85e
--- a/server/sources/ldapuser.py	Fri Jul 02 09:05:56 2010 +0200
+++ b/server/sources/ldapuser.py	Fri Jul 02 09:09:59 2010 +0200
@@ -19,8 +19,6 @@
 
 this source is for now limited to a read-only CWUser source
 
-
-
 Part of the code is coming form Zope's LDAPUserFolder
 
 Copyright (c) 2004 Jens Vagelpohl.
@@ -297,10 +295,12 @@
         # check password by establishing a (unused) connection
         try:
             self._connect(user, password)
+        except ldap.LDAPError, ex:
+            # Something went wrong, most likely bad credentials
+            self.info('while trying to authenticate %s: %s', user, ex)
+            raise AuthenticationError()
         except Exception:
-            self.error('while trying to authenticate %s: %s', user,
-                       exc_info=True)
-            # Something went wrong, most likely bad credentials
+            self.error('while trying to authenticate %s', user, exc_info=True)
             raise AuthenticationError()
         return self.extid2eid(user['dn'], 'CWUser', session)