mirror of https://github.com/jumpserver/jumpserver
pull/2/head
parent
f4591e3aad
commit
1a529a7d7f
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue