예제 #1
0
파일: bmservice.py 프로젝트: swenker/bmlist
    def signin(self,email,passwd):
        email = email.lower()
        passwd=tomd5(passwd)
        result = db.select(TABLE_USER,where='email=$email',vars=locals())
        if result:
            r=result[0]
            user = User()
            user.email=r['email']
            user.nickname=r['nickname']
            user.cellphone=r['cellphone']
            user.status = r['status']

            pwindb=r['passwd']
            #TODO compare char by char?
            if pwindb == passwd:
                return user

        return None
예제 #2
0
 def persistUser(self,username,email,password):
     user = User()
     user.username = username
     user.hashed_password = hashlib.sha256(password).hexdigest()
     user.email = email
     return user.put().id()