Exemplo n.º 1
0
def passwordreset(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/login/')
    if request.user.is_authenticated() and request.method == 'POST':
        oldpass = request.POST['oldPassword']
        if check_password(oldpass, request.user.password):
            oldpasscheck = request.POST['oldPasswordCheck']
            newpass = request.POST['newPassword']
            if oldpass == oldpasscheck and oldpass != newpass:
                request.user.set_password(newpass)
                request.user.save()
                a_logout(request)
                return HttpResponseRedirect('/login/')
            else:
                return HttpResponseRedirect('/password-reset/')    
        else:
            return HttpResponseRedirect('/password-reset/')    
    return render(request, 'password-reset.html', {})
Exemplo n.º 2
0
def auth_logout(request):
    if request.method == 'GET' or request.method == 'POST':
        a_logout(request)
        return redirect('/member/auth_index')
Exemplo n.º 3
0
def logout(request):
    a_logout(request)
    return HttpResponseRedirect('/login/')    
Exemplo n.º 4
0
def logout(request):
    if request.method == "GET":
        a_logout(request)
        return redirect('/')
Exemplo n.º 5
0
def auth_logout(request):
    if request.method == 'GET' or request.method == 'POST':
        a_logout(request)
        return redirect('/')