コード例 #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)