mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-25 18:54:29 +01:00
more logical return for get_user
This commit is contained in:
parent
b65fe7bc7b
commit
efa7012adb
@ -37,7 +37,7 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
def auth(self, username, password):
|
def auth(self, username, password):
|
||||||
|
|
||||||
binddn = self.get_user(username, False)
|
binddn = self.get_user(username, False)
|
||||||
if binddn:
|
if not binddn is None:
|
||||||
ldap_client = self._connect()
|
ldap_client = self._connect()
|
||||||
try:
|
try:
|
||||||
ldap_client.simple_bind_s(binddn, password)
|
ldap_client.simple_bind_s(binddn, password)
|
||||||
@ -97,7 +97,7 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
)
|
)
|
||||||
if len(r) == 0:
|
if len(r) == 0:
|
||||||
ldap_client.unbind_s()
|
ldap_client.unbind_s()
|
||||||
return False
|
return None
|
||||||
|
|
||||||
ldap_client.unbind_s()
|
ldap_client.unbind_s()
|
||||||
if attrs:
|
if attrs:
|
||||||
|
Loading…
Reference in New Issue
Block a user