Skip to content

Commit

Permalink
[#3012] Show unauthorized not login if appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Nov 9, 2012
1 parent 40e3597 commit 139276c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/controllers/user.py
Expand Up @@ -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):
Expand Down
20 changes: 20 additions & 0 deletions ckan/templates/user/unauthorized.html
@@ -0,0 +1,20 @@
{% extends "page.html" %}

{% block subtitle %}{{ _('Not Authorized') }}{% endblock %}

{% block breadcrumb_content %}
{% endblock %}

{% block primary_content %}
<section class="module">
<div class="module-content">
<h1 class="page-heading">{{ _('Not Authorized') }}</h1>
{% trans %}
You are not yet authorized to view this page
{% endtrans %}
</div>
</section>
{% endblock %}

{% block secondary_content %}
{% endblock %}

0 comments on commit 139276c

Please sign in to comment.