diff --git a/seafile-ldap.py b/seafile-ldap.py index b257214..5d7ef35 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -172,11 +172,11 @@ logger.debug("Finished SQL query for LDAPUsers") # Loop through the ldap users and make sure they are in the sql ldap users table # if they are not in the sql table, insert a new row to add them # if they are disabled in the sql table, enable them -set_sqlLDAPusers = set(sqlLDAPusers) -for user in ldapUsers: - if [item for item in sqlLDAPusers if user.mail in item]: - logger.debug("LDAP User {0} is already in the SQL Table".format(user.mail)) - logger.debug("item {0} is already in the SQL Table".format(item)) +for ldapUser in ldapUsers: + for sqlUser in sqlLDAPusers: + if ldapUser.mail in sqlUser: + logger.debug("LDAP User {0} is already in the SQL Table".format(user.mail)) + logger.debug("SQL LDAP User is active: {0}".format(bool(sqlUser[4]))) #seafileUsers = request('admin/search-user/?query=@johnhgaunt.com', seafileURL, seafileToken)['response']['user_list'] #for user in seafileUsers: