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
1a529a7d
Commit
1a529a7d
authored
Oct 07, 2014
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
f4591e3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
views.py
webroot/AutoSa/AutoSa/views.py
+6
-2
showUser.html
webroot/AutoSa/templates/showUser.html
+2
-2
No files found.
webroot/AutoSa/AutoSa/views.py
View file @
1a529a7d
...
@@ -609,16 +609,20 @@ def showSudo(request):
...
@@ -609,16 +609,20 @@ def showSudo(request):
if
not
username
:
if
not
username
:
return
HttpResponseRedirect
(
'/showUser/'
)
return
HttpResponseRedirect
(
'/showUser/'
)
l
=
LDAPMgmt
()
l
=
LDAPMgmt
()
result
=
l
.
list
(
'entryDN=cn=
%
s,Sudoers,
%
s'
%
(
str
(
username
),
ldap_base_dn
),
attr
=
[
'sudoHost'
,
'sudoCommand'
])
result
=
l
.
list
(
'entryDN=cn=
%
s,
ou=
Sudoers,
%
s'
%
(
str
(
username
),
ldap_base_dn
),
attr
=
[
'sudoHost'
,
'sudoCommand'
])
sudoHost
=
result
.
get
(
'sudoHost'
)
sudoHost
=
result
.
get
(
'sudoHost'
)
sudoCommand
=
result
.
get
(
'sudoCommand'
)
sudoCommand
=
result
.
get
(
'sudoCommand'
)
return
render_to_response
(
'showSudo.html'
,
return
render_to_response
(
'showSudo.html'
,
{
'sudoHost'
:
sudoHost
,
{
'username'
:
username
,
'sudoHost'
:
sudoHost
,
'sudoCommand'
:
sudoCommand
,
'sudoCommand'
:
sudoCommand
,
'user_menu'
:
'active'
},
'user_menu'
:
'active'
},
context_instance
=
RequestContext
(
request
))
context_instance
=
RequestContext
(
request
))
@admin_required
def
chgSudo
(
request
):
pass
...
...
webroot/AutoSa/templates/showUser.html
View file @
1a529a7d
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
<td>
{{ user.email }}
</td>
<td>
{{ user.email }}
</td>
<td><a
href=
"/downKey/?username={{ user.username }}"
>
下载
</a></td>
<td><a
href=
"/downKey/?username={{ user.username }}"
>
下载
</a></td>
<td><a
href=
"/chgUser/?username={{ user.username }}"
>
修改
</a></td>
<td><a
href=
"/chgUser/?username={{ user.username }}"
>
修改
</a></td>
<td><a
href=
"/showSudo/?username={{ user.username }"
>
查看
</a></td>
<td><a
href=
"/showSudo/?username={{ user.username }
}
"
>
查看
</a></td>
<td><a
href=
"/chgSudo/?username={{ user.username }"
>
修改
</a></td>
<td><a
href=
"/chgSudo/?username={{ user.username }
}
"
>
修改
</a></td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
...
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