Update seafile-ldap.py

This commit is contained in:
2021-11-02 13:17:51 -04:00
parent 57798c8e04
commit 229b6422fd

View File

@@ -166,9 +166,9 @@ for ldapUser in ldapUsers:
logger.debug("Checking if LDAP user is in SQl Table")
cnx = mysql.connector.connect(**dbconfig)
cursor = cnx.cursor()
query = ("SELECT * FROM LDAPUsers WHERE email = %s")
cursor.execute(query, (str(ldapUser.mail),))
logger.debug("Cursor: {0}".format(cursor))
query = "SELECT * FROM LDAPUsers WHERE email = '%s'" % ldapUser.mail
logger.debug("Query: {0}".format(query))
cursor.execute(query)
row_count = cursor.rowcount
logger.debug("Found {0} SQL LDAP user".format(cursor.rowcount))
sqlLDAPuser = cursor.fetchall()