server/sources/ldapuser.py
changeset 6653 52d1568af412
parent 6427 c8a5ac2d1eaa
child 6693 65bd93b72f1e
equal deleted inserted replaced
6652:592c88c8f018 6653:52d1568af412
   264             session.close()
   264             session.close()
   265 
   265 
   266     def get_connection(self):
   266     def get_connection(self):
   267         """open and return a connection to the source"""
   267         """open and return a connection to the source"""
   268         if self._conn is None:
   268         if self._conn is None:
   269             self._connect()
   269             try:
       
   270                 self._connect()
       
   271             except:
       
   272                 self.exception('cant connect to ldap')
   270         return ConnectionWrapper(self._conn)
   273         return ConnectionWrapper(self._conn)
   271 
   274 
   272     def authenticate(self, session, login, password=None, **kwargs):
   275     def authenticate(self, session, login, password=None, **kwargs):
   273         """return CWUser eid for the given login/password if this account is
   276         """return CWUser eid for the given login/password if this account is
   274         defined in this source, else raise `AuthenticationError`
   277         defined in this source, else raise `AuthenticationError`