From ab8c380bb109d5d2dfe8dcae627566566f162e1c Mon Sep 17 00:00:00 2001 From: kakwa Date: Fri, 22 May 2015 09:51:46 +0200 Subject: [PATCH] adding the possibility to get a list of attributes in get_user --- ldapcherry/backend/backendLdap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ldapcherry/backend/backendLdap.py b/ldapcherry/backend/backendLdap.py index f503232..241cd29 100644 --- a/ldapcherry/backend/backendLdap.py +++ b/ldapcherry/backend/backendLdap.py @@ -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