示例#1
0
def Authenticate(request):
    h = request.cookies.get('name')
    user_id = hashes.check_secure_val(h)
    if user_id:
        user = User.getById(user_id)
        if user and user.active:
            return user
示例#2
0
def AdminAuthenticate(request):
        h = request.cookies.get('name_adm')
        admin_id = hashes.check_secure_val(h)
        if not admin_id:
        	return None
        admin = Admin.get_by_id(int(admin_id))
        return admin