update ldap group search
This commit is contained in:
@@ -230,20 +230,17 @@ for sqlLDAPuser in sqlLDAPusers:
|
|||||||
else:
|
else:
|
||||||
logger.error("There was an error setting user {0} to disabled in Seafile".format(sqlLDAPuser[1]))
|
logger.error("There was an error setting user {0} to disabled in Seafile".format(sqlLDAPuser[1]))
|
||||||
|
|
||||||
exit()
|
|
||||||
|
|
||||||
|
|
||||||
# get ad groups and import them into seafile
|
# get ad groups and import them into seafile
|
||||||
# loop through each group and list members
|
# loop through each group and list members
|
||||||
# compare members to users in seafile group
|
# compare members to users in seafile group
|
||||||
# add users to group if missing and in the seafile group
|
# add users to group if missing and in the seafile group
|
||||||
# remove members in not in group or seafile group
|
# remove members in not in group or seafile group
|
||||||
# remove seafile groups if ad group is removed
|
# remove seafile groups if ad group is removed
|
||||||
ldap.search(config['LDAP SERVER']['groupBaseDN'], '(objectClass=group)', attributes=['*'])
|
ldap.search(ldapBase, '(objectClass=group)', attributes=['*'])
|
||||||
#print(ldap.entries)
|
#print(ldap.entries)
|
||||||
for group in ldap.entries:
|
for group in ldap.entries:
|
||||||
try:
|
try:
|
||||||
if group.member:
|
if group.member:
|
||||||
logger.debug("{0}".format(group.name))
|
logger.info("{0}".format(group.name))
|
||||||
finally:
|
finally:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user