Beispiel #1
0
def add_cliente(request):
    usr = UsrService.get_instance()
    res,form = usr.add_cliente(request)
    if res :
        return HttpResponse('[{"r":true,"n":"%s","c":"%s"}]'%(form[0],form[1]),content_type='application/json')
    #end if
    return render(request,'usr/add_cliente.html',{'form':form})
Beispiel #2
0
def pass_cambio(request):
    usr = UsrService.get_instance()
    r,f = usr.pass_cambio(request)
    if r :
        return HttpResponse('[{"r":true}]',content_type='application/json')
    #end if
    return render(request,'usr/pass_cambio.html',{'form':f})
Beispiel #3
0
def logout(request):
    usr = UsrService.get_instance()
    usr.logout(request)
    return redirect("/")
Beispiel #4
0
def login_do(request):
    usr = UsrService.get_instance()
    if usr.login(request):
        return redirect("/")
    #end if
    return redirect("/usr/login/?error=true")
Beispiel #5
0
def logout(request):
	usr = UsrService.get_instance()
	usr.logout(request)
	return redirect("/")
Beispiel #6
0
def login_do(request):
	usr = UsrService.get_instance()
	if usr.login(request):
		return HttpResponse(status=200)
	#end if
	return HttpResponse(status=400)
Beispiel #7
0
 def func(request, *args, **kwargs):
     usr = UsrService.get_instance()
     if usr.es_usuario(request):
         return view(request, *args, **kwargs)
     else:
         return redirect("/")
Beispiel #8
0
 def func(request, *args, **kwargs):
     usr = UsrService.get_instance()
     if usr.es_cliente(request):
         return view(request, *args, **kwargs)
     else:
         return redirect("/")