From 6b861a90283d61c6fea53aa1e6632ab3a224b6ce Mon Sep 17 00:00:00 2001 From: Alex Kamedov Date: Sun, 24 Apr 2011 20:02:36 +0600 Subject: [PATCH] process warn GET argument on login page --- cas_provider/templates/cas/warn.html | 15 +++++++++++++++ cas_provider/views.py | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 cas_provider/templates/cas/warn.html diff --git a/cas_provider/templates/cas/warn.html b/cas_provider/templates/cas/warn.html new file mode 100644 index 0000000..58f4ed8 --- /dev/null +++ b/cas_provider/templates/cas/warn.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block title %} +Warning +{% endblock %} + +{% block content %} +
+
+ Confirm to log in to {{ service }} + +

+
+
+{% endblock %} diff --git a/cas_provider/views.py b/cas_provider/views.py index eca61ba..8a6e4bf 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -23,10 +23,16 @@ ERROR_MESSAGES = ( def login(request, template_name='cas/login.html', \ - success_redirect=settings.LOGIN_REDIRECT_URL): + success_redirect=settings.LOGIN_REDIRECT_URL, + warn_template_name='cas/warn.html'): service = request.GET.get('service', None) if request.user.is_authenticated(): if service is not None: + if request.GET.get('warn', False): + return render_to_response(warn_template_name, { + 'service': service, + 'warn': False + }, context_instance=RequestContext(request)) ticket = ServiceTicket.objects.create(service=service, user=request.user) return HttpResponseRedirect(ticket.get_redirect_url()) else: -- 2.20.1