Exemple #1
0
def logout(request):
    lgout(request)
    return render(
        request, 'register/login.html', {
            'message':
            'You are logged out Successfully ....Enter below to login again'
        })
Exemple #2
0
def login(request):
    lgout(request)
    if request.method == 'POST':
        inpusername = request.POST['username_input']
        inppassword = request.POST['password_input']
        x = encrypt(inppassword)
        user = authenticate(request, username=inpusername, password=x)
        if user is None:
            blank_form = LoginForm()
            message = "Error! Wrong username or password."
            flag = 1
            context = {'form': blank_form, 'message': message, 'flag': flag}
            return render(request, 'account/login.html', context)
        else:
            lgin(request, user)
            CaseObjList = Case.objects.all()
            ReqObj = None
            for obj in CaseObjList:
                if obj.username == inpusername and obj.password == x:
                    ReqObj = obj
                    break
            prof = ReqObj.place
            id = prof.id
            return redirect(profile, id=id)
    else:  #if get method, create a blank form.
        blank_form = LoginForm()
        message = ""
        flag = 0
        context = {'form': blank_form, 'message': message, 'flag': flag}
        return render(request, 'account/login.html', context)
Exemple #3
0
def login(request):
    lgout(request)
    if request.method == 'POST':
        username = request.POST.get('username', None)
        password = request.POST.get('passwd', None)
        user = authenticate(request, username=username, password=password)
        if user:
            lgin(request, user)
            return redirect('VMS:index')
        else:
            return render(request, 'VMS/login.html')
    else:
        return render(request, 'VMS/login.html')
Exemple #4
0
def logout(request):
        lgout(request)
        return redirect('/')
Exemple #5
0
def logout(request):
    lgout(request)
    return render(request,'registration/logout.html')
Exemple #6
0
def logout(request):
    if request.method == 'POST':
        lgout(request)
        return HttpResponseRedirect('frontpage:index')
Exemple #7
0
def logout(request):
    if not request.user.is_authenticated:
        return redirect('login')
    lgout(request)
    return redirect("login")
def logout(request):
        lgout(request)
        return redirect('login')
Exemple #9
0
def logout(request):
	lgout(request)
	return HttpResponseRedirect('/')
Exemple #10
0
def logout(request):
    lgout(request)
    return HttpResponseRedirect('/')
Exemple #11
0
def logout(request):
    lgout(request)
    return redirect('VMS:index')
Exemple #12
0
def logout(request, forum_id):
    lgout(request)
    forum = get_forum_instance(forum_id)
    if forum:
        return redirect("base_forum", forum_id=forum.local_id)
    raise Http404
Exemple #13
0
def logout(request):
    lgout(request)
    return redirect(reverse_lazy('users:login'))
Exemple #14
0
def logout(request, forum_id):
    lgout(request)
    forum = get_forum_instance(forum_id)
    if forum:
        return redirect('base_forum', forum_id=forum.local_id)
    raise Http404
Exemple #15
0
def logout(request):
    lgout(request)
    return redirect("login")
Exemple #16
0
def logout(request):
    lgout(request)
    return render(request,'register/login.html',{'message':'You are logged out Successfully ....Enter below to login again'})
Exemple #17
0
def logout(request):
    lgout(request)
    return render(request, 'registration/logout.html')