From 6b4ddbe9462337c4689c2469fa0a617a311a267c Mon Sep 17 00:00:00 2001 From: Jan Broer Date: Tue, 13 Oct 2015 18:07:17 +0200 Subject: [PATCH] Fix: admin functions were accessible for regular users --- cps/templates/register.html | 12 +++--- cps/templates/user_edit.html | 24 +++++++----- cps/web.py | 73 +++++++++++++++++++++++++++++------- 3 files changed, 80 insertions(+), 29 deletions(-) diff --git a/cps/templates/register.html b/cps/templates/register.html index d3785d18..205de9d4 100644 --- a/cps/templates/register.html +++ b/cps/templates/register.html @@ -3,17 +3,17 @@

Register a new account

-
+
- +
-
+
- +
-
+
- +
diff --git a/cps/templates/user_edit.html b/cps/templates/user_edit.html index 559f6914..81ae0446 100644 --- a/cps/templates/user_edit.html +++ b/cps/templates/user_edit.html @@ -3,27 +3,31 @@

{{title}}

+ {% if g.user and g.user.role and new_user %} +
+ + +
+ {% endif %}
- - + +
- +
- {% if g.user and g.user.role %} + {% if g.user and g.user.role and not profile %}
- - -
-
- - + +
+ {% endif %} + {% if g.user and g.user.role and not profile and not new_user %}