mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-04 20:37:48 +02:00
adding the possibility to get a list of attributes in get_user
This commit is contained in:
parent
f4906bb090
commit
ab8c380bb1
1 changed files with 4 additions and 3 deletions
|
@ -56,7 +56,7 @@ class Backend(ldapcherry.backend.Backend):
|
|||
def del_user(self, username):
|
||||
pass
|
||||
|
||||
def get_user(self, username):
|
||||
def get_user(self, username, attrs=None):
|
||||
ldap_client = self._connect()
|
||||
try:
|
||||
ldap_client.simple_bind_s(self.binddn, self.bindpassword)
|
||||
|
@ -80,8 +80,9 @@ class Backend(ldapcherry.backend.Backend):
|
|||
|
||||
r = ldap_client.search_s(self.userdn,
|
||||
ldap.SCOPE_SUBTREE,
|
||||
user_filter
|
||||
)
|
||||
user_filter,
|
||||
attrlist=attrs
|
||||
)
|
||||
if len(r) == 0:
|
||||
ldap_client.unbind_s()
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue