diff options
Diffstat (limited to 'sql.py')
-rw-r--r-- | sql.py | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -247,6 +247,21 @@ def query_email(xmail): return c +def clobber_email(userid, oldmail, newmail): + w = db.cursor(dictionary=True) + w.execute("SELECT `userpw` FROM `login` WHERE `userid`='%s' AND `email`='%s'" % (userid, oldmail)) + r = w.fetchall() + c = "" + for it in r: + c+=str(it) + w.close() + w = db.cursor() + w.execute("UPDATE `login` SET `email` = '%s' WHERE `userid`='%s' AND `email`='%s'" % (newmail, userid, oldmail)) + w.close() + + return c + + def add_player(xmail): # TODO: Generate password using the whole alphabet. # The original string have 32 letters and we're using only 12 |