From 139276cc96d8ab1d857771e3a52725158602620d Mon Sep 17 00:00:00 2001 From: tobes Date: Fri, 9 Nov 2012 12:33:19 +0000 Subject: [PATCH] [#3012] Show unauthorized not login if appropriate --- ckan/controllers/user.py | 3 +++ ckan/templates/user/unauthorized.html | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ckan/templates/user/unauthorized.html diff --git a/ckan/controllers/user.py b/ckan/controllers/user.py index 92f27a7422f..27f33726fc0 100644 --- a/ckan/controllers/user.py +++ b/ckan/controllers/user.py @@ -295,6 +295,9 @@ def login(self, error=None): vars = {} return render('user/login.html', extra_vars=vars) else: + # if the user is unauthorized display appropriate page + if c.unauthorized_user: + return render('user/unauthorized.html') return render('user/logout_first.html') def logged_in(self): diff --git a/ckan/templates/user/unauthorized.html b/ckan/templates/user/unauthorized.html new file mode 100644 index 00000000000..b2bca5f0075 --- /dev/null +++ b/ckan/templates/user/unauthorized.html @@ -0,0 +1,20 @@ +{% extends "page.html" %} + +{% block subtitle %}{{ _('Not Authorized') }}{% endblock %} + +{% block breadcrumb_content %} +{% endblock %} + +{% block primary_content %} +
+
+

{{ _('Not Authorized') }}

+ {% trans %} + You are not yet authorized to view this page + {% endtrans %} +
+
+{% endblock %} + +{% block secondary_content %} +{% endblock %}