Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
6418033e
Commit
6418033e
authored
Oct 09, 2014
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 chgsudo
parent
f48dd468
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
misc.xml
.idea/misc.xml
+0
-7
views.py
webroot/AutoSa/AutoSa/views.py
+6
-2
info.html
webroot/AutoSa/templates/info.html
+12
-0
showSudo.html
webroot/AutoSa/templates/showSudo.html
+0
-2
No files found.
.idea/misc.xml
View file @
6418033e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 2.7.6 (C:/Python27/python.exe)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"PyConsoleOptionsProvider"
>
<option
name=
"myPythonConsoleState"
>
<console-settings
is-module-sdk=
"true"
>
<option
name=
"myUseModuleSdk"
value=
"true"
/>
</console-settings>
</option>
</component>
</project>
webroot/AutoSa/AutoSa/views.py
View file @
6418033e
...
...
@@ -637,11 +637,13 @@ def chgSudo(request):
msg
=
''
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
(
','
)
hosts
=
str
(
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
(
'add_host'
):
if
not
ori_hosts
:
ori_hosts
=
[]
ori_hosts
.
extend
(
hosts
)
new_hosts
=
list
(
set
(
ori_hosts
))
else
:
...
...
@@ -652,10 +654,12 @@ def chgSudo(request):
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
(
','
)
cmds
=
str
(
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
(
'add_cmd'
):
if
not
ori_cmds
:
ori_cmds
=
[]
ori_cmds
.
extend
(
cmds
)
new_cmds
=
list
(
set
(
ori_cmds
))
else
:
...
...
webroot/AutoSa/templates/info.html
View file @
6418033e
...
...
@@ -21,6 +21,18 @@
history
.
go
(
-
1
);
}
</script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5js"></script>
<![endif]-->
<link
href=
"/static/css/bootstrap.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/main.css"
rel=
"stylesheet"
>
<script
src=
"/static/js/main.js"
></script>
<script
src=
"/static/js/jquery.min.js"
></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
src=
"/static/js/bootstrap.min.js"
></script>
</head>
<body>
...
...
webroot/AutoSa/templates/showSudo.html
View file @
6418033e
...
...
@@ -3,7 +3,6 @@
<fieldset
>
<legend>
{{ username }}
</legend>
<b>
允许sudo的主机:
</b>
<hr
/>
<ul
class=
"list-group"
>
{% for host in sudoHost %}
<li
class=
"list-group-item"
>
{{ host }}
</li>
...
...
@@ -11,7 +10,6 @@
</ul>
<br
/>
<b>
允许的sudo命令:
</b>
<hr
/>
<ul
class=
"list-group"
>
{% for cmd in sudoCommand %}
<li
class=
"list-group-item"
>
{{ cmd }}
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment