24 lines
No EOL
556 B
Python
24 lines
No EOL
556 B
Python
# db.py
|
|
|
|
import mysql.connector
|
|
|
|
# database settings
|
|
DBUSER = "gundersena"
|
|
DBPASSWORD = "remoteaccess"
|
|
DBHOST = "75.86.178.105"
|
|
|
|
|
|
cnx = mysql.connector.connect(user=DBUSER, password=DBPASSWORD, host=DBHOST, database="accounts")
|
|
cursor = cnx.cursor(buffered=True)
|
|
|
|
# Verify that an email is a valid crimata_id.
|
|
def verify(crimata_id, get=False):
|
|
query = f"SELECT * FROM accounts.accounts WHERE crimata_id='{crimata_id}';"
|
|
|
|
cursor.execute(query)
|
|
|
|
verified = False
|
|
for (_, crimata_id, _) in cursor:
|
|
verified = True
|
|
|
|
return verified |