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
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
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
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
def Authenticate(request): h = request.cookies.get('name') user_id = hashes.check_secure_val(h) if user_id: user = User.get_by_id(int(user_id)) return user