Commit 9ba54bd6 authored by Andrea Veri's avatar Andrea Veri

Stop looking for the memberUid field, FreeIPA uses member by default

parent 57e6e34a
......@@ -25,18 +25,22 @@ except ldap.LDAPError, e:
def _parse_members_from_group(group):
filter = ldap.filter.filter_format('(&(objectClass=posixgroup)(cn=%s))', (group, ))
results = l.search_s(LDAP_GROUP_BASE, ldap.SCOPE_SUBTREE, filter, ('memberUid', ))
filter = ldap.filter.filter_format('(&(objectClass=posixGroup)(cn=%s))', (group, ))
results = l.search_s(LDAP_GROUP_BASE, ldap.SCOPE_SUBTREE, filter, ('member', ))
members = set()
for _, attr in results:
for userid in attr['member']:
splitentry = userid.split(',')
singleentry = splitentry[0]
splitteduid = singleentry.split('=')
uid = splitteduid[1]
return members
def _get_attributes_from_ldap(userid, attr):
filter = ldap.filter.filter_format('(uid=%s)', (userid, ))
results = l.search_s(LDAP_USER_BASE, ldap.SCOPE_SUBTREE, filter, ('uid', attr, ))
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