浏览代码

group edit; refactoring templates

Roberto Berto 4 年之前
父节点
当前提交
e0270393db
共有 52 个文件被更改,包括 80 次插入83 次删除
  1. 1 3
      vycontrol/accounts/templates/accounts/login.html
  2. 1 3
      vycontrol/accounts/templates/accounts/logout.html
  3. 1 3
      vycontrol/accounts/templates/accounts/lost.html
  4. 1 3
      vycontrol/accounts/templates/accounts/password_reset.html
  5. 1 3
      vycontrol/accounts/templates/accounts/password_reset_complete.html
  6. 1 3
      vycontrol/accounts/templates/accounts/password_reset_sent.html
  7. 1 3
      vycontrol/accounts/templates/accounts/password_reset_token.html
  8. 1 4
      vycontrol/accounts/templates/accounts/profile.html
  9. 1 3
      vycontrol/accounts/templates/accounts/start.html
  10. 0 1
      vycontrol/config/templates/config/group_add.html
  11. 27 0
      vycontrol/config/templates/config/group_edit.html
  12. 4 3
      vycontrol/config/templates/config/groups_list.html
  13. 0 1
      vycontrol/config/templates/config/instance_add.html
  14. 0 1
      vycontrol/config/templates/config/instance_conntry.html
  15. 3 3
      vycontrol/config/templates/config/instances.html
  16. 0 1
      vycontrol/config/templates/config/user_add.html
  17. 0 3
      vycontrol/config/templates/config/user_edit.html
  18. 3 3
      vycontrol/config/templates/config/users_list.html
  19. 1 1
      vycontrol/config/urls.py
  20. 30 1
      vycontrol/config/views.py
  21. 0 3
      vycontrol/dnsresolver/templates/dnsresolver/add.html
  22. 0 4
      vycontrol/dnsresolver/templates/dnsresolver/list.html
  23. 0 1
      vycontrol/firewall/templates/firewall/addressgroup-add.html
  24. 0 1
      vycontrol/firewall/templates/firewall/addressgroup-desc.html
  25. 0 1
      vycontrol/firewall/templates/firewall/addressgroup-list.html
  26. 0 1
      vycontrol/firewall/templates/firewall/create.html
  27. 0 1
      vycontrol/firewall/templates/firewall/edit.html
  28. 0 1
      vycontrol/firewall/templates/firewall/editrule.html
  29. 0 1
      vycontrol/firewall/templates/firewall/list.html
  30. 0 1
      vycontrol/firewall/templates/firewall/networkgroup-add.html
  31. 0 1
      vycontrol/firewall/templates/firewall/networkgroup-desc.html
  32. 0 1
      vycontrol/firewall/templates/firewall/networkgroup-list.html
  33. 0 1
      vycontrol/firewall/templates/firewall/portgroup-add.html
  34. 0 1
      vycontrol/firewall/templates/firewall/portgroup-edit.html
  35. 0 1
      vycontrol/firewall/templates/firewall/portgroup-list.html
  36. 0 1
      vycontrol/firewall/templates/firewall/show.html
  37. 0 1
      vycontrol/firewall/templates/firewall/zones-add.html
  38. 0 1
      vycontrol/firewall/templates/firewall/zones-addrule.html
  39. 0 1
      vycontrol/firewall/templates/firewall/zones-edit.html
  40. 0 1
      vycontrol/firewall/templates/firewall/zones-remove.html
  41. 0 1
      vycontrol/firewall/templates/firewall/zones-removerule.html
  42. 0 1
      vycontrol/firewall/templates/firewall/zones.html
  43. 0 1
      vycontrol/interface/templates/interface/add.html
  44. 0 1
      vycontrol/interface/templates/interface/add_vlan.html
  45. 0 1
      vycontrol/interface/templates/interface/index.html
  46. 0 1
      vycontrol/interface/templates/interface/show.html
  47. 0 1
      vycontrol/ntp/templates/ntp/add.html
  48. 0 1
      vycontrol/ntp/templates/ntp/list.html
  49. 1 1
      vycontrol/perms.py
  50. 1 1
      vycontrol/static/templates/static/add.html
  51. 0 1
      vycontrol/static/templates/static/list.html
  52. 1 1
      vycontrol/vycontrol/templates/base.html

+ 1 - 3
vycontrol/accounts/templates/accounts/login.html

@@ -2,9 +2,7 @@
 
 
 {% block header_title %}Login{% endblock %}
 {% block header_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/logout.html

@@ -2,9 +2,7 @@
 
 
 {% block header_title %}Logged out{% endblock %}
 {% block header_title %}Logged out{% endblock %}
 {% block section_title %}Logged out{% endblock %}
 {% block section_title %}Logged out{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/lost.html

@@ -2,9 +2,7 @@
 
 
 {% block header_title %}Login{% endblock %}
 {% block header_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
 {% block section_title %}Login{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/password_reset.html

@@ -1,9 +1,7 @@
 {% extends "base_not_logged.html" %}
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset{% endblock %}
 {% block header_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/password_reset_complete.html

@@ -1,9 +1,7 @@
 {% extends "base_not_logged.html" %}
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset complete{% endblock %}
 {% block header_title %}Password Reset complete{% endblock %}
 {% block section_title %}Password Reset complete{% endblock %}
 {% block section_title %}Password Reset complete{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/password_reset_sent.html

@@ -1,9 +1,7 @@
 {% extends "base_not_logged.html" %}
 {% extends "base_not_logged.html" %}
 {% block header_title %}Password Reset{% endblock %}
 {% block header_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
 {% block section_title %}Password Reset{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/password_reset_token.html

@@ -1,9 +1,7 @@
 {% extends "base_not_logged.html" %}
 {% extends "base_not_logged.html" %}
 {% block header_title %}Change your password{% endblock %}
 {% block header_title %}Change your password{% endblock %}
 {% block section_title %}Change your password{% endblock %}
 {% block section_title %}Change your password{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 4
vycontrol/accounts/templates/accounts/profile.html

@@ -2,9 +2,6 @@
 
 
 {% block header_title %}Profile{% endblock %}
 {% block header_title %}Profile{% endblock %}
 {% block section_title %}Profile{% endblock %}
 {% block section_title %}Profile{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ user }}
 {{ user }}
@@ -46,4 +43,4 @@
 
 
 
 
 
 
-{% endblock %}
+{% endblock %}

+ 1 - 3
vycontrol/accounts/templates/accounts/start.html

@@ -2,9 +2,7 @@
 
 
 {% block header_title %}Installing{% endblock %}
 {% block header_title %}Installing{% endblock %}
 {% block section_title %}Installing{% endblock %}
 {% block section_title %}Installing{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 1
vycontrol/config/templates/config/group_add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Add new group{% endblock %}
 {% block header_title %}Add new group{% endblock %}
 {% block section_title %}Add new group{% endblock %}
 {% block section_title %}Add new group{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block content %}
 {% block content %}
 
 

+ 27 - 0
vycontrol/config/templates/config/group_edit.html

@@ -0,0 +1,27 @@
+{% extends "base.html" %}
+
+{% block header_title %}dnsresolver{% endblock %}
+{% block section_title %}dnsresolver{% endblock %}
+
+{% block content %}
+
+{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
+
+<form action="{% url 'config:group-edit' group %}" method="post">
+{% csrf_token %}
+
+<p>Name only accept letters, numbers and _-.</p>
+
+<p>
+    <label for="alias">Name</label><br>
+    <input type="text" name="name" id="name" value="{{ group.name }}" size="60">
+</p>
+
+
+<input type="submit" value="Edit user">
+</form>
+
+
+
+{% endblock %}
+

+ 4 - 3
vycontrol/config/templates/config/groups_list.html

@@ -6,9 +6,9 @@
 {% endblock %}
 {% endblock %}
 
 
 
 
-{% block header_title %}Manage groups{% endblock %}
-{% block section_title %}Manage groups{% endblock %}
-{% block username %}{{ username }}{% endblock %}
+{% block header_title %}dnsresolver{% endblock %}
+{% block section_title %}dnsresolver{% endblock %}
+
 
 
 {% block content %}
 {% block content %}
 
 
@@ -33,6 +33,7 @@
         <td>{{ group }}</td>
         <td>{{ group }}</td>
         <td>{% if group.active == True %}active{% else %}inactive{% endif %}</td>
         <td>{% if group.active == True %}active{% else %}inactive{% endif %}</td>
         <td>
         <td>
+            <a href="{% url 'config:group-edit' group %}">edit</a> | 
             {% if group.active == True %}<a href="{% url 'config:group-inactivate' group %}">inactivate</a>{% else %}<a href="{% url 'config:group-activate' group %}">activate</a>{% endif %}
             {% if group.active == True %}<a href="{% url 'config:group-inactivate' group %}">inactivate</a>{% else %}<a href="{% url 'config:group-activate' group %}">activate</a>{% endif %}
         </td>
         </td>
 
 

+ 0 - 1
vycontrol/config/templates/config/instance_add.html

@@ -3,7 +3,6 @@
 
 
 {% block header_title %}Add new instance{% endblock %}
 {% block header_title %}Add new instance{% endblock %}
 {% block section_title %}Add new instance{% endblock %}
 {% block section_title %}Add new instance{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block content %}
 {% block content %}
 
 

+ 0 - 1
vycontrol/config/templates/config/instance_conntry.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}List instances{% endblock %}
 {% block header_title %}List instances{% endblock %}
 {% block section_title %}List instances{% endblock %}
 {% block section_title %}List instances{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block content %}
 {% block content %}
 
 

+ 3 - 3
vycontrol/config/templates/config/instances.html

@@ -1,8 +1,8 @@
 {% extends "base.html" %}
 {% extends "base.html" %}
 
 
-{% block header_title %}List instances{% endblock %}
-{% block section_title %}List instances{% endblock %}
-{% block username %}{{ username }}{% endblock %}
+{% block header_title %}dnsresolver{% endblock %}
+{% block section_title %}dnsresolver{% endblock %}
+
 
 
 {% block debug %}
 {% block debug %}
     {% for instance in instances %}
     {% for instance in instances %}

+ 0 - 1
vycontrol/config/templates/config/user_add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Add new user{% endblock %}
 {% block header_title %}Add new user{% endblock %}
 {% block section_title %}Add new user{% endblock %}
 {% block section_title %}Add new user{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block content %}
 {% block content %}
 
 

+ 0 - 3
vycontrol/config/templates/config/user_edit.html

@@ -2,9 +2,6 @@
 
 
 {% block header_title %}User edit{% endblock %}
 {% block header_title %}User edit{% endblock %}
 {% block section_title %}User edit{% endblock %}
 {% block section_title %}User edit{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ user }}
 {{ user }}

+ 3 - 3
vycontrol/config/templates/config/users_list.html

@@ -7,9 +7,9 @@
 {% endblock %}
 {% endblock %}
 
 
 
 
-{% block header_title %}List users{% endblock %}
-{% block section_title %}List users{% endblock %}
-{% block username %}{{ username }}{% endblock %}
+{% block header_title %}dnsresolver{% endblock %}
+{% block section_title %}dnsresolver{% endblock %}
+
 
 
 {% block content %}
 {% block content %}
 
 

+ 1 - 1
vycontrol/config/urls.py

@@ -13,7 +13,7 @@ urlpatterns = [
     path('user-edit/<str:username>', views.user_edit, name='user-edit'),
     path('user-edit/<str:username>', views.user_edit, name='user-edit'),
     path('groups-list', views.groups_list, name='groups-list'),
     path('groups-list', views.groups_list, name='groups-list'),
     path('group-add', views.group_add, name='group-add'),
     path('group-add', views.group_add, name='group-add'),
-    #path('group-edit/<str:group_name>', views.group_edit, name='group-edit'),
+    path('group-edit/<str:group_name>', views.group_edit, name='group-edit'),
     path('group-activate/<str:group_name>', views.group_activate, name='group-activate'),
     path('group-activate/<str:group_name>', views.group_activate, name='group-activate'),
     path('group-inactivate/<str:group_name>', views.group_inactivate, name='group-inactivate'),
     path('group-inactivate/<str:group_name>', views.group_inactivate, name='group-inactivate'),
 
 

+ 30 - 1
vycontrol/config/views.py

@@ -397,4 +397,33 @@ def group_activate(request, group_name):
         group.active = True
         group.active = True
         group.save()
         group.save()
 
 
-    return redirect('config:groups-list')
+    return redirect('config:groups-list')
+
+
+@perms.is_superuser
+@is_authenticated    
+def group_edit(request, group_name):
+    vinfo = viewinfo.prepare(request)
+
+    if validator_group(group_name):
+        group = Group.objects.get(name=group_name)
+
+        if request.POST.get('name', None) != None:
+            newname = request.POST.get('name').strip()
+
+            if validator_group(newname):
+                group.name = newname
+                group.save()
+            else:
+                vinfo.msg.add_error('Group name only accept letters, numbers and _-.')
+            
+    else:
+        return redirect('config:groups-list')
+
+    context = viewinfo.context(vinfo)    
+    localcontext = {
+        'group':             group
+    }
+    context.update(localcontext)
+
+    return render(request, 'config/group_edit.html', context)     

+ 0 - 3
vycontrol/dnsresolver/templates/dnsresolver/add.html

@@ -2,9 +2,6 @@
 
 
 {% block header_title %}dnsresolver{% endblock %}
 {% block header_title %}dnsresolver{% endblock %}
 {% block section_title %}dnsresolver{% endblock %}
 {% block section_title %}dnsresolver{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 4
vycontrol/dnsresolver/templates/dnsresolver/list.html

@@ -2,10 +2,6 @@
 
 
 {% block header_title %}dnsresolver{% endblock %}
 {% block header_title %}dnsresolver{% endblock %}
 {% block section_title %}dnsresolver{% endblock %}
 {% block section_title %}dnsresolver{% endblock %}
-{% block username %}{{ username }}{% endblock %}
-{% block debugactive %}{{ debug }}{% endblock %}
-{% block creditsactive %}{{ vycontrol_credits }}{% endblock %}
-
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 1
vycontrol/firewall/templates/firewall/addressgroup-add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Add New Address Group{% endblock %}
 {% block header_title %}Firewall Add New Address Group{% endblock %}
 {% block section_title %}Firewall Add New Address Group{% endblock %}
 {% block section_title %}Firewall Add New Address Group{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 1
vycontrol/firewall/templates/firewall/addressgroup-desc.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Edit Addressgroup{% endblock %}
 {% block header_title %}Edit Addressgroup{% endblock %}
 {% block section_title %}Edit Addressgroup{% endblock %}
 {% block section_title %}Edit Addressgroup{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_all }}
 {{ firewall_all }}

+ 0 - 1
vycontrol/firewall/templates/firewall/addressgroup-list.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Group List{% endblock %}
 {% block header_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_addressgroup }}
 {{ firewall_addressgroup }}

+ 0 - 1
vycontrol/firewall/templates/firewall/create.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Create Firewall{% endblock %}
 {% block header_title %}Create Firewall{% endblock %}
 {% block section_title %}Create Firewall{% endblock %}
 {% block section_title %}Create Firewall{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_all }}
 {{ firewall_all }}

+ 0 - 1
vycontrol/firewall/templates/firewall/edit.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Edit Firewall{% endblock %}
 {% block header_title %}Edit Firewall{% endblock %}
 {% block section_title %}Edit Firewall{% endblock %}
 {% block section_title %}Edit Firewall{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_all }}
 {{ firewall_all }}

+ 0 - 1
vycontrol/firewall/templates/firewall/editrule.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall {{firewall_name}} - rule {{ firewall_rulenumber }}{% endblock %}
 {% block header_title %}Firewall {{firewall_name}} - rule {{ firewall_rulenumber }}{% endblock %}
 {% block section_title %}<a href="{% url 'firewall:show' firewall_name %}">Firewall {{firewall_name}}</a> - edit rule {{ firewall_rulenumber }}{% endblock %}
 {% block section_title %}<a href="{% url 'firewall:show' firewall_name %}">Firewall {{firewall_name}}</a> - edit rule {{ firewall_rulenumber }}{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 
 
 {% block submenu %}
 {% block submenu %}

+ 0 - 1
vycontrol/firewall/templates/firewall/list.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall List{% endblock %}
 {% block header_title %}Firewall List{% endblock %}
 {% block section_title %}Firewall List{% endblock %}
 {% block section_title %}Firewall List{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 
 
 {% block debug %}
 {% block debug %}

+ 0 - 1
vycontrol/firewall/templates/firewall/networkgroup-add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Add New Address Group{% endblock %}
 {% block header_title %}Firewall Add New Address Group{% endblock %}
 {% block section_title %}Firewall Add New Address Group{% endblock %}
 {% block section_title %}Firewall Add New Address Group{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 1
vycontrol/firewall/templates/firewall/networkgroup-desc.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Edit Addressgroup{% endblock %}
 {% block header_title %}Edit Addressgroup{% endblock %}
 {% block section_title %}Edit Addressgroup{% endblock %}
 {% block section_title %}Edit Addressgroup{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_all }}
 {{ firewall_all }}

+ 0 - 1
vycontrol/firewall/templates/firewall/networkgroup-list.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Group List{% endblock %}
 {% block header_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_networkgroup }}
 {{ firewall_networkgroup }}

+ 0 - 1
vycontrol/firewall/templates/firewall/portgroup-add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Add New Port Group{% endblock %}
 {% block header_title %}Firewall Add New Port Group{% endblock %}
 {% block section_title %}Firewall Add New Port Group{% endblock %}
 {% block section_title %}Firewall Add New Port Group{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/portgroup-edit.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Edit Port Group {{ groupname }}{% endblock %}
 {% block header_title %}Firewall Edit Port Group {{ groupname }}{% endblock %}
 {% block section_title %}Firewall Edit Port Group {{ groupname }}{% endblock %}
 {% block section_title %}Firewall Edit Port Group {{ groupname }}{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/portgroup-list.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Group List{% endblock %}
 {% block header_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
 {% block section_title %}Firewall Group List{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall_portgroup }}
 {{ firewall_portgroup }}

+ 0 - 1
vycontrol/firewall/templates/firewall/show.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall {{firewall_name}}{% endblock %}
 {% block header_title %}Firewall {{firewall_name}}{% endblock %}
 {% block section_title %}<a href="{% url 'firewall:show' firewall_name %}">Firewall {{firewall_name}}</a>{% endblock %}
 {% block section_title %}<a href="{% url 'firewall:show' firewall_name %}">Firewall {{firewall_name}}</a>{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ firewall }}
 {{ firewall }}

+ 0 - 1
vycontrol/firewall/templates/firewall/zones-add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Zone{% endblock %}
 {% block header_title %}Firewall Zone{% endblock %}
 {% block section_title %}Firewall Zone{% endblock %}
 {% block section_title %}Firewall Zone{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/zones-addrule.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Add Firewall Ruleset to Zone{% endblock %}
 {% block header_title %}Add Firewall Ruleset to Zone{% endblock %}
 {% block section_title %}Add Firewall Ruleset to Zone{% endblock %}
 {% block section_title %}Add Firewall Ruleset to Zone{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/zones-edit.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Zone{% endblock %}
 {% block header_title %}Firewall Zone{% endblock %}
 {% block section_title %}Firewall Zone{% endblock %}
 {% block section_title %}Firewall Zone{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/zones-remove.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Remove Firewall Zone{% endblock %}
 {% block header_title %}Remove Firewall Zone{% endblock %}
 {% block section_title %}Remove Firewall Zone{% endblock %}
 {% block section_title %}Remove Firewall Zone{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/zones-removerule.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Remove Firewall Zone Rule{% endblock %}
 {% block header_title %}Remove Firewall Zone Rule{% endblock %}
 {% block section_title %}Remove Firewall Zone Rule{% endblock %}
 {% block section_title %}Remove Firewall Zone Rule{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/firewall/templates/firewall/zones.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Firewall Zones{% endblock %}
 {% block header_title %}Firewall Zones{% endblock %}
 {% block section_title %}Firewall Zones{% endblock %}
 {% block section_title %}Firewall Zones{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 
 

+ 0 - 1
vycontrol/interface/templates/interface/add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Interface add{% endblock %}
 {% block header_title %}Interface add{% endblock %}
 {% block section_title %}Interface add{% endblock %}
 {% block section_title %}Interface add{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ interface }}
 {{ interface }}

+ 0 - 1
vycontrol/interface/templates/interface/add_vlan.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Interface add vlan{% endblock %}
 {% block header_title %}Interface add vlan{% endblock %}
 {% block section_title %}Interface add vlan{% endblock %}
 {% block section_title %}Interface add vlan{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ interface }}
 {{ interface }}

+ 0 - 1
vycontrol/interface/templates/interface/index.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Interfaces List{% endblock %}
 {% block header_title %}Interfaces List{% endblock %}
 {% block section_title %}Interfaces List{% endblock %}
 {% block section_title %}Interfaces List{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
     {{ interfaces }}
     {{ interfaces }}

+ 0 - 1
vycontrol/interface/templates/interface/show.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}Interface {{ interface_type }} {{ interface_name }}{% endblock %}
 {% block header_title %}Interface {{ interface_type }} {{ interface_name }}{% endblock %}
 {% block section_title %}Interface {{ interface_type }} {{ interface_name }}{% endblock %}
 {% block section_title %}Interface {{ interface_type }} {{ interface_name }}{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {{ interface }}
 {{ interface }}

+ 0 - 1
vycontrol/ntp/templates/ntp/add.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}NTP{% endblock %}
 {% block header_title %}NTP{% endblock %}
 {% block section_title %}NTP{% endblock %}
 {% block section_title %}NTP{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 0 - 1
vycontrol/ntp/templates/ntp/list.html

@@ -2,7 +2,6 @@
 
 
 {% block header_title %}NTP{% endblock %}
 {% block header_title %}NTP{% endblock %}
 {% block section_title %}NTP{% endblock %}
 {% block section_title %}NTP{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 {% block debug %}
 {% block debug %}
 {% endblock %}
 {% endblock %}

+ 1 - 1
vycontrol/perms.py

@@ -57,7 +57,7 @@ def is_superuser(func):
 
 
         if is_admin == False:
         if is_admin == False:
             auth.logout(request)
             auth.logout(request)
-            return redirect('accounts-login')
+            return redirect('%s?next=%s' % (reverse('accounts-login'), request.path))
 
 
         value = func(*args, **kwargs)
         value = func(*args, **kwargs)
         return value
         return value

+ 1 - 1
vycontrol/static/templates/static/add.html

@@ -2,7 +2,7 @@
 
 
 {% block header_title %}Static Routes{% endblock %}
 {% block header_title %}Static Routes{% endblock %}
 {% block section_title %}Static Routes{% endblock %}
 {% block section_title %}Static Routes{% endblock %}
-{% block username %}{{ username }}{% endblock %}
+
 
 
 
 
 {% block debug %}
 {% block debug %}

+ 0 - 1
vycontrol/static/templates/static/list.html

@@ -4,7 +4,6 @@
 
 
 {% block header_title %}Static Routes{% endblock %}
 {% block header_title %}Static Routes{% endblock %}
 {% block section_title %}Static Routes{% endblock %}
 {% block section_title %}Static Routes{% endblock %}
-{% block username %}{{ username }}{% endblock %}
 
 
 
 
 {% block debug %}
 {% block debug %}

+ 1 - 1
vycontrol/vycontrol/templates/base.html

@@ -130,7 +130,7 @@
 </div>
 </div>
 {% endif %}
 {% endif %}
 
 
-{% if creditsactive %}
+{% if vycontrol_credits %}
 <hr>
 <hr>
 <div class="container" id="credits">
 <div class="container" id="credits">
   <a href="https://vycontrol.com/">VyControl</a>
   <a href="https://vycontrol.com/">VyControl</a>