Exemplo n.º 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
Exemplo n.º 2
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
Exemplo n.º 3
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
Exemplo n.º 4
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
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