26 lines
No EOL
624 B
Python
26 lines
No EOL
624 B
Python
# db.py
|
|
|
|
import mysql.connector
|
|
|
|
# database settings
|
|
DBUSER = "remoteAccess"
|
|
DBPASSWORD = "remoteAccess2020"
|
|
DBHOST = "75.86.178.105"
|
|
|
|
# People Schema
|
|
# -------------
|
|
|
|
people_cnx = mysql.connector.connect(user=DBUSER, password=DBPASSWORD, host=DBHOST, database="People")
|
|
people_cursor = people_cnx.cursor(buffered=True)
|
|
|
|
# Verify that an email is a valid crimata_id.
|
|
def verify(crimata_id, get=False):
|
|
query = (f"SELECT * FROM People.users WHERE crimata_id='{crimata_id}';")
|
|
|
|
people_cursor.execute(query)
|
|
|
|
verified = False
|
|
for (_, crimata_id, _) in people_cursor:
|
|
verified = True
|
|
|
|
return verified |