Commit 6c678882 authored by Wade Fitzpatrick's avatar Wade Fitzpatrick

Correct failure behaviour in login

parent 9e262bd1
......@@ -171,12 +171,15 @@ class LdapUser(UserMixin, BUIuser):
:param passwd: password to bind to the LDAP server with
:type passwd: str
:returns: True if successful, otherwise de-activates the user and returns None
:returns: True if found and bind was successful;
False if found but bind failed;
otherwise de-activates the user and returns False
"""
if self.ldap.fetch(name):
return self.ldap.check(self.id, passwd)
else:
self.active = False
return False
def is_active(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment