From 031b92bf035ea138c4385d737cb6e721b06b835e Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Wed, 8 Oct 2014 12:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=87=EE=86=BD=E6=95=BCchgSudo.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webroot/AutoSa/AutoSa/views.py | 10 +++-- webroot/AutoSa/templates/chgSudo.html | 57 ++++++++++++++++++++++++++ webroot/AutoSa/templates/showSudo.html | 6 +-- 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 webroot/AutoSa/templates/chgSudo.html diff --git a/webroot/AutoSa/AutoSa/views.py b/webroot/AutoSa/AutoSa/views.py index ba25fcf56..8e7240de5 100644 --- a/webroot/AutoSa/AutoSa/views.py +++ b/webroot/AutoSa/AutoSa/views.py @@ -619,11 +619,15 @@ def showSudo(request): 'user_menu': 'active'}, context_instance=RequestContext(request)) - @admin_required def chgSudo(request): - pass - + if request.method == 'GET': + username = request.GET.get('username') + if not username: + return HttpResponseRedirect('/showUser/') + return render_to_response('chgSudo.html') + else: + return HttpResponseRedirect('/') @admin_required diff --git a/webroot/AutoSa/templates/chgSudo.html b/webroot/AutoSa/templates/chgSudo.html new file mode 100644 index 000000000..752a97e78 --- /dev/null +++ b/webroot/AutoSa/templates/chgSudo.html @@ -0,0 +1,57 @@ +{% extends 'base.html' %} +{% block content %} +
+ {{ username }} +
+
+
+
+ + + + +
+
+
+
+ +
+
+
+
+ + + + +
+
+
+
+ +
+
+
+
+ + + + +
+
+
+
+ +
+
+
+
+ + + + +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/webroot/AutoSa/templates/showSudo.html b/webroot/AutoSa/templates/showSudo.html index 41795f5e5..48c649a30 100644 --- a/webroot/AutoSa/templates/showSudo.html +++ b/webroot/AutoSa/templates/showSudo.html @@ -2,20 +2,18 @@ {% block content %}
{{ username }} - 允许sudo的主机: + 允许sudo的主机:
- 允许的sudo命令: - + 允许sudo的主机: -
{% endblock %} \ No newline at end of file