Exemplo n.º 1
0
def ChangePassword(request):
    kwvars = {'request':request}
    if request.method=='POST':
        form = ChangePasswordForm(user=request.user,data=request.POST)
        if form.is_valid():
            form.save()
            kwvars['form'] = form
	    kwvars['msg'] = "修改成功,请退出重新登录!"
            return render_to_response('UserManage/password.change.html',kwvars,RequestContext(request))
            #return HttpResponseRedirect(reverse('logouturl'))
    else:
        form = ChangePasswordForm(user=request.user)
    kwvars['form'] = form
    return render_to_response('UserManage/password.change.html',kwvars,RequestContext(request))
Exemplo n.º 2
0
def ChangePassword(request):
    if request.method == "POST":
        form = ChangePasswordForm(user=request.user, data=request.POST)
        if form.is_valid():
            user = request.user.username
            modifyldappassword(user, form.cleaned_data["old_password"], form.cleaned_data["new_password1"])
            form.save()
            return HttpResponseRedirect(reverse("logouturl"))
    else:
        form = ChangePasswordForm(user=request.user)

    kwvars = {"form": form, "request": request}

    return render_to_response("UserManage/password.change.html", kwvars, RequestContext(request))
Exemplo n.º 3
0
def ChangePassword(request):
    if request.method=='POST':
        form = ChangePasswordForm(user=request.user,data=request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('logouturl'))
    else:
        form = ChangePasswordForm(user=request.user)

    kwvars = {
        'form':form,
        'request':request,
    }

    return render_to_response('UserManage/password.change.html',kwvars,RequestContext(request))
Exemplo n.º 4
0
def changepassword(request):
    if request.method == 'POST':
        form = ChangePasswordForm(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('logouturl'))
    else:
        form = ChangePasswordForm(user=request.user)
    kwvars = {
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/password.change.html', kwvars, RequestContext(request))
Exemplo n.º 5
0
def ChangePassword(request):
    kwvars = {'request': request}
    if request.method == 'POST':
        form = ChangePasswordForm(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()
            kwvars['form'] = form
            kwvars['msg'] = "修改成功,请退出重新登录!"
            return render_to_response('UserManage/password.change.html',
                                      kwvars, RequestContext(request))
            #return HttpResponseRedirect(reverse('logouturl'))
    else:
        form = ChangePasswordForm(user=request.user)
    kwvars['form'] = form
    return render_to_response('UserManage/password.change.html', kwvars,
                              RequestContext(request))
Exemplo n.º 6
0
def ChangePassword(request):
    if request.method == 'POST':
        form = ChangePasswordForm(user=request.user, data=request.POST)
        if form.is_valid():
            user = request.user.username
            modifyldappassword(user, form.cleaned_data['old_password'],
                               form.cleaned_data['new_password1'])
            form.save()
            return HttpResponseRedirect(reverse('logouturl'))
    else:
        form = ChangePasswordForm(user=request.user)

    kwvars = {
        'form': form,
        'request': request,
    }

    return render_to_response('UserManage/password.change.html', kwvars,
                              RequestContext(request))