From eb30f37f500fb838ec5366eb4fe3a0991d66349f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 17 Aug 2019 02:11:08 +0500 Subject: [PATCH] LIST USERS should also be available from the /users/ page. --- .../templates/userManagment/index.html | 151 ++++++++++-------- userManagment/views.py | 7 +- 2 files changed, 90 insertions(+), 68 deletions(-) diff --git a/userManagment/templates/userManagment/index.html b/userManagment/templates/userManagment/index.html index 2c495faf5..ddf72aab1 100755 --- a/userManagment/templates/userManagment/index.html +++ b/userManagment/templates/userManagment/index.html @@ -3,79 +3,96 @@ {% block title %}{% trans "User Functions - CyberPanel" %}{% endblock %} {% block content %} -{% load static %} -{% get_current_language as LANGUAGE_CODE %} - + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + -
-
-

{% trans "User Functions" %}

-

{% trans "Create, edit and delete users on this page." %}

-
-
-
-

- {% trans "Available Functions" %} -

-
-
- - {% if type != 3 %} - - - - - {% endif %} - - - {% if type != 3 %} - +
+
+

{% trans "User Functions" %}

+

{% trans "Create, edit and delete users on this page." %}

+
+
+
+

+ {% trans "Available Functions" %} +

+
+ - - {% endif %} - -
+
+
-
-
{% endblock %} diff --git a/userManagment/views.py b/userManagment/views.py index 9369b6737..4b9caaa18 100755 --- a/userManagment/views.py +++ b/userManagment/views.py @@ -18,7 +18,12 @@ def loadUserHome(request): val = request.session['userID'] try: admin = Administrator.objects.get(pk=val) - return render(request, 'userManagment/index.html', {"type": admin.type}) + currentACL = ACLManager.loadedACL(val) + if currentACL['admin'] == 1: + listUsers = 1 + else: + listUsers = currentACL['listUsers'] + return render(request, 'userManagment/index.html', {"type": admin.type, 'listUsers': listUsers}) except BaseException, msg: logging.CyberCPLogFileWriter.writeToFile(str(msg)) return HttpResponse(str(msg))