Exemple #1
0
 def validCode(cls,username,code):
     cdinfo = SecurityHandler.loadCode(code,keepAlive=True)
     return cdinfo and cdinfo["username"]==username
Exemple #2
0
 def generateCode(cls,username):
     cd = ""
     while SecurityHandler.exists(cd) or cd=="":
         cd = utility.generateCode(6)
     SecurityHandler.bindCode(cd,info = dict(username=username),expire= 24*60)
     return cd