Compare commits
2 Commits
1cb8be0822
...
bca8d5f201
| Author | SHA1 | Date | |
|---|---|---|---|
| bca8d5f201 | |||
| b5a074bfa2 |
@@ -267,7 +267,6 @@ for ldapGroup in ldapGroups:
|
||||
if seafileGroup['name'] == ldapGroup.name:
|
||||
for ldapGroupMember in ldapGroup.member:
|
||||
logger.debug("Searching for LDAP user {0}".format(ldapGroupMember))
|
||||
#ldap.search(ldapBase, '(&(distinguishedName={0})(mail=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2))({1}))'.format(ldapGroupMember, ldapFilter), attributes=['mail'])
|
||||
ldap.search(ldapBase, '(&(distinguishedName={0})(mail=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2))({1}))'.format(filter.filter_format('%s', (ldapGroupMember,)), ldapFilter), attributes=['mail'])
|
||||
count = len(ldap.entries)
|
||||
logger.debug("Found {0} LDAP user.".format(count))
|
||||
@@ -290,7 +289,7 @@ seafileGroups = request('admin/groups/', seafileURL, seafileToken)['response']['
|
||||
for seafileGroup in seafileGroups:
|
||||
# need to check if group exists in ad first and if not delete it
|
||||
logger.debug("Searching for ldap group {0}.".format(seafileGroup))
|
||||
ldap.search(ldapBase, '(samaccountname={1})'.format(seafileGroup), attributes=['*'])
|
||||
ldap.search(ldapBase, '(samaccountname={0})'.format(seafileGroup), attributes=['*'])
|
||||
count = len(ldap.entries)
|
||||
logger.debug("Found {0} LDAP group.".format(count))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user