예제 #1
0
파일: Email.py 프로젝트: f7el/freeChamp
def refreshVerification(email):
    db = get_db()
    dt = query_db("SELECT datetime('now','localtime')", one=True)
    t = (dt[0], email)
    db.execute("UPDATE VERIFICATION SET timestamp=? WHERE email=(?)", t)
    updateVerificationCount(email, 1)
    g.db.commit()
예제 #2
0
파일: Email.py 프로젝트: f7el/freeChamp
def addVerification(email, token):
    db = get_db()
    dt = query_db("SELECT datetime('now','localtime')", one=True)
    t = (token, dt[0], email)
    db.execute("INSERT INTO VERIFICATION values(?,?,'0',?)", t)
    updateVerificationCount(email, 1)
    g.db.commit()
예제 #3
0
파일: Email.py 프로젝트: f7el/freeChamp
def verificationFromToday(email):
    g.db = get_db()
    t = (email, )
    result = query_db("SELECT count(strftime('%Y-%m-%d',timestamp,'localtime')) from verification WHERE strftime(" + \
                     "'%Y-%m-%d',timestamp,'localtime')=strftime('%Y-%m-%d','now','localtime') and email=?",t,one=True)
    count = result[0]
    return count == 1
예제 #4
0
파일: Email.py 프로젝트: f7el/freeChamp
def makeEmailActive(email):
    g.db = get_db()
    t = (email, )
    g.db.execute('UPDATE USERS SET isVerified=1 WHERE email=?', t)
    g.db.commit()
예제 #5
0
파일: Email.py 프로젝트: f7el/freeChamp
def updateVerificationCount(email, count):
    t = (count, email)
    g.db = get_db()
    g.db.execute('UPDATE verification SET count=? WHERE email=?', t)
    g.db.commit()
예제 #6
0
파일: Email.py 프로젝트: f7el/freeChamp
def resetVerificationCount(email):
    g.db = get_db()
    t = (email, )
    g.db.execute('UPDATE verification SET count=0 WHERE email=?', t)
    g.db.commit()