예제 #1
0
파일: user.py 프로젝트: vcelis/cs253-wiki
 def login(cls, name, pw):
   """Returns the entity instance if the provided username and password match"""
   u = User.getName(name)
   return u if u and u.pw == utils.genPwHash(name, pw, u.pw.split('|')[0]) else None
예제 #2
0
파일: user.py 프로젝트: vcelis/cs253-wiki
 def register(cls, name, pw, email=None):
   """Returns a new entity instance for the given attributes"""
   pw = utils.genPwHash(name, pw)
   return cls(parent=User.getKey(), name=name, pw=pw, email=email)