Compare commits

...

2 Commits

Author SHA1 Message Date
bca8d5f201 typo 2022-05-19 16:09:21 -04:00
b5a074bfa2 removed old ldap search line 2022-05-19 16:04:49 -04:00

View File

@@ -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))