summaryrefslogtreecommitdiff
path: root/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'sql.py')
-rw-r--r--sql.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql.py b/sql.py
index 21aa065..0f79033 100644
--- a/sql.py
+++ b/sql.py
@@ -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