From 9020c11bd2980073cc8a2d9ee6916420c1f12b0a Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Wed, 8 Oct 2014 22:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=87=EE=86=BD=E6=95=BCchgSudo=E9=90=A8?= =?UTF-8?q?=E5=89=89iew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webroot/AutoSa/AutoSa/views.py | 13 +++++++------ webroot/AutoSa/templates/chgSudo.html | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/webroot/AutoSa/AutoSa/views.py b/webroot/AutoSa/AutoSa/views.py index 1212b6313..fd1cbcfcf 100644 --- a/webroot/AutoSa/AutoSa/views.py +++ b/webroot/AutoSa/AutoSa/views.py @@ -635,12 +635,13 @@ def chgSudo(request): username = request.POST.get('username') user_dn = 'cn=%s,ou=Sudoers,%s' % (str(username), ldap_base_dn) msg = '' - if request.POST.get('addHost') or request.POST.get('delHost'): - host = request.POST.get('host') + if request.POST.get('add_host') or request.POST.get('del_host'): + host = request.POST.get('add_host') if request.POST.get('add_host') else request.POST.get('del_host') hosts = host.split(',') ori_hosts = l.list('entryDN=cn=%s,ou=Sudoers,%s' % (str(username), ldap_base_dn), attr=['sudoHost']).get('sudoHost') - if request.POST.get('addHost'): + + if request.POST.get('add_host'): new_hosts = list(set(ori_hosts.extend(hosts))) else: new_hosts = list(set(ori_hosts) - set(hosts)) @@ -648,12 +649,12 @@ def chgSudo(request): msg = '修改sudo主机成功' % hosts - if request.POST.get('addCMD') or request.POST.get('delCMD'): - cmd = request.POST.get('cmd') + if request.POST.get('add_cmd') or request.POST.get('del_cmd'): + cmd = request.POST.get('add_cmd') if request.POST.get('add_cmd') else request.POST.get('del_cmd') cmds = cmd.split(',') ori_cmds = l.list('entryDN=cn=%s,ou=Sudoers,%s' % (str(username), ldap_base_dn), attr=['sudoCommand']).get('sudoCommand') - if request.POST.get('addCMD'): + if request.POST.get('add_cmd'): new_cmds = list(set(ori_cmds.extend(cmds))) else: new_cmds = list(set(ori_hosts) - cmds) diff --git a/webroot/AutoSa/templates/chgSudo.html b/webroot/AutoSa/templates/chgSudo.html index 1ab6b3e4e..6954e420c 100644 --- a/webroot/AutoSa/templates/chgSudo.html +++ b/webroot/AutoSa/templates/chgSudo.html @@ -2,12 +2,12 @@ {% block content %}
{{ username }}--修改sudo -
+
- + @@ -17,12 +17,12 @@
-
+
- + @@ -32,12 +32,12 @@
-
+
- + @@ -52,7 +52,7 @@
- +