added logger for ldap user not in table

This commit is contained in:
2021-11-02 12:32:36 -04:00
parent f054e4cb53
commit 9242052e6f

View File

@@ -175,7 +175,7 @@ logger.debug("Finished SQL query for LDAPUsers")
for ldapUser in ldapUsers:
# loop through the sql ldap users
for sqlUser in sqlLDAPusers:
# look to make sure the ldap user is in the table
# look to make sure the ldap user is in the table and then make sure they are active in Seafile
if ldapUser.mail in sqlUser:
# are they active
is_active = bool(sqlUser[4])
@@ -190,8 +190,11 @@ for ldapUser in ldapUsers:
logger.info("User {0} was set to active in Seafile".format(ldapUser.mail))
else:
logger.error("There was an error setting user {0} to active in Seafile".format(ldapUser.mail))
#else:
# user is not in the SQL table
else:
logger.debug("LDAP User {0} is NOT in the SQL Table".format(ldapUser.mail))
# add user to ldap table
insert = ''
#seafileUsers = request('admin/search-user/?query=@johnhgaunt.com', seafileURL, seafileToken)['response']['user_list']