diff --git a/seafile-ldap.py b/seafile-ldap.py index d4cdf90..5f8e650 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -163,12 +163,17 @@ logger.debug("Starting SQL query for LDAPUsers") query = ("SELECT * FROM LDAPUsers") logger.debug("Query: {0}".format(query)) cursor.execute(query) -sqlLDAPusers = cursor.fetchall() +results = cursor.fetchall() logger.debug("Found {0} SQL LDAP users".format(cursor.rowcount)) -for user in sqlLDAPusers: +sqlLDAPusers = [] +for user in results: logger.debug("User: {0} - Active: {1}".format(user[1], bool(user[4]))) + temp['email'] = user[1] + temp['is_active'] = user[4] + sqlLDAPusers.append(temp) logger.debug("Finished SQL query for LDAPUsers") - +print(sqlLDAPusers) +exit() # 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