server/ldaputils.py
changeset 8329 ac2b17bd7311
parent 8250 171a9d6bff8f
child 8384 98782f17dd84
equal deleted inserted replaced
8328:c53bbeea7870 8329:ac2b17bd7311
   201         searchstr = '(&%s)' % ''.join(searchfilter)
   201         searchstr = '(&%s)' % ''.join(searchfilter)
   202         # first search the user
   202         # first search the user
   203         try:
   203         try:
   204             user = self._search(session, self.user_base_dn,
   204             user = self._search(session, self.user_base_dn,
   205                                 self.user_base_scope, searchstr)[0]
   205                                 self.user_base_scope, searchstr)[0]
   206         except IndexError:
   206         except (IndexError, ldap.SERVER_DOWN):
   207             # no such user
   207             # no such user
   208             raise AuthenticationError()
   208             raise AuthenticationError()
   209         # check password by establishing a (unused) connection
   209         # check password by establishing a (unused) connection
   210         try:
   210         try:
   211             self._connect(user, password)
   211             self._connect(user, password)