equal
deleted
inserted
replaced
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) |