Skip to content
Permalink
Browse files

LIST USERS should also be available from the /users/ page.

  • Loading branch information...
usmannasir committed Aug 16, 2019
1 parent afdbc36 commit eb30f37f500fb838ec5366eb4fe3a0991d66349f
Showing with 85 additions and 63 deletions.
  1. +79 −62 userManagment/templates/userManagment/index.html
  2. +6 −1 userManagment/views.py
@@ -3,79 +3,96 @@
{% block title %}{% trans "User Functions - CyberPanel" %}{% endblock %}
{% block content %}

{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->


<div class="container">
<div id="page-title">
<h2>{% trans "User Functions" %}</h2>
<p>{% trans "Create, edit and delete users on this page." %}</p>
</div>
<div class="panel col-md-11">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Available Functions" %}
</h3>
<div class="example-box-wrapper">
<div class="row">
<div class="col-md-3 btn-min-width">
<a href="{% url 'viewProfile' %}" title="{% trans 'View Profile' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "View Profile" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-id-card"></i>
</div>
</a>
</div>
{% if type != 3 %}
<div class="col-md-3 btn-min-width">
<a href="{% url 'createUser' %}" title="{% trans 'Create User' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Create User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-user"></i>
</div>
</a>
</div>
<div class="container">
<div id="page-title">
<h2>{% trans "User Functions" %}</h2>
<p>{% trans "Create, edit and delete users on this page." %}</p>
</div>
<div class="panel col-md-11">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Available Functions" %}
</h3>
<div class="example-box-wrapper">
<div class="row">
<div class="col-md-3 btn-min-width">
<a href="{% url 'viewProfile' %}" title="{% trans 'View Profile' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "View Profile" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-id-card"></i>
</div>
</a>
</div>
{% if listUsers %}
<div class="col-md-3 btn-min-width">
<a href="{% url 'listUsers' %}" title="{% trans 'List Users' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "List Users" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-id-card"></i>
</div>
</a>
</div>
{% endif %}
{% if type != 3 %}
<div class="col-md-3 btn-min-width">
<a href="{% url 'createUser' %}" title="{% trans 'Create User' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Create User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-user"></i>
</div>
</a>
</div>

<div class="col-md-3 btn-min-width">
<a href="{% url 'modifyUsers' %}" title="{% trans 'Modify User' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Modify User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-edit"></i>
</div>
</a>
</div>
<div class="col-md-3 btn-min-width">
<a href="{% url 'modifyUsers' %}" title="{% trans 'Modify User' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Modify User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-edit"></i>
</div>
</a>
</div>

{% endif %}
{% endif %}


{% if type != 3 %}
{% if type != 3 %}

<div class="col-md-3 btn-min-width">
<a href="{% url 'deleteUser' %}" title="{% trans 'Delete User' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Delete User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-trash"></i>
</div>
</a>
</div>
<div class="col-md-3 btn-min-width">
<a href="{% url 'deleteUser' %}" title="{% trans 'Delete User' %}"
class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "Delete User" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-trash"></i>
</div>
</a>
</div>

{% endif %}
{% endif %}

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>


{% endblock %}
@@ -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))

0 comments on commit eb30f37

Please sign in to comment.
You can’t perform that action at this time.