mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
staff users are allowed to change vnc settings of instances
This commit is contained in:
parent
311f1b793e
commit
52fbe95e30
2 changed files with 3 additions and 3 deletions
|
@ -537,7 +537,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if request.user.is_superuser or userinstance.is_vnc %}
|
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab">
|
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab">
|
||||||
{% trans "VNC" %}
|
{% trans "VNC" %}
|
||||||
|
@ -963,7 +963,7 @@
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if request.user.is_superuser or userinstance.is_vnc %}
|
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}
|
||||||
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="vncsettings">
|
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="vncsettings">
|
||||||
<p>{% trans "To set console's type, shutdown the instance." %}</p>
|
<p>{% trans "To set console's type, shutdown the instance." %}</p>
|
||||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||||
|
|
|
@ -645,7 +645,7 @@ def instance(request, compute_id, vname):
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#xmledit')
|
return HttpResponseRedirect(request.get_full_path() + '#xmledit')
|
||||||
|
|
||||||
if request.user.is_superuser or userinstance.is_vnc:
|
if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc:
|
||||||
if 'set_console_passwd' in request.POST:
|
if 'set_console_passwd' in request.POST:
|
||||||
if request.POST.get('auto_pass', ''):
|
if request.POST.get('auto_pass', ''):
|
||||||
passwd = randomPasswd()
|
passwd = randomPasswd()
|
||||||
|
|
Loading…
Reference in a new issue