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
49dcdf3b
Commit
49dcdf3b
authored
Jan 22, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加修改页面
parent
f951471f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
urls.py
juser/urls.py
+1
-0
views.py
juser/views.py
+21
-0
footer.html
templates/footer.html
+1
-1
user_list.html
templates/juser/user_list.html
+1
-1
No files found.
juser/urls.py
View file @
49dcdf3b
...
...
@@ -12,4 +12,5 @@ urlpatterns = patterns('juser.views',
(
r'^group_list/$'
,
'group_list'
),
(
r'^user_detail/$'
,
'user_detail'
),
(
r'^user_del/$'
,
'user_del'
),
(
r'^user_edit/$'
,
'user_edit'
),
)
juser/views.py
View file @
49dcdf3b
...
...
@@ -187,6 +187,27 @@ def user_del(request):
return
HttpResponseRedirect
(
'/juser/user_list/'
,
locals
())
def
user_edit
(
request
):
if
request
.
method
==
'GET'
:
username
=
request
.
GET
.
get
(
'username'
,
None
)
if
not
username
:
return
HttpResponseRedirect
(
'/'
)
user
=
User
.
objects
.
get
(
username
=
username
)
username
=
user
.
username
password
=
user
.
password
ssh_key_pwd1
=
user
.
ssh_key_pwd1
name
=
user
.
name
all_group
=
UserGroup
.
objects
.
all
()
groups
=
user
.
user_group
.
all
()
groups_str
=
' '
.
join
([
group
.
name
for
group
in
groups
])
user_role
=
{
'SU'
:
u'超级管理员'
,
'GA'
:
u'组管理员'
,
'CU'
:
u'普通用户'
}
role_post
=
user
.
role
ssh_pwd
=
user
.
ssh_pwd
email
=
user
.
email
return
render_to_response
(
'juser/user_add.html'
,
locals
())
def
db_add_user
(
**
kwargs
):
groups_post
=
kwargs
.
pop
(
'groups'
)
user
=
User
(
**
kwargs
)
...
...
templates/footer.html
View file @
49dcdf3b
<div
class=
"footer fixed"
>
<div
class=
"pull-right"
>
Version
<strong>
2
.2.0
</strong>
GPL.
Version
<strong>
1
.2.0
</strong>
GPL.
</div>
<div>
<strong>
Copyright
</strong>
Jumpserver.org Organization
©
2014-2015
...
...
templates/juser/user_list.html
View file @
49dcdf3b
...
...
@@ -59,7 +59,7 @@
<td
class=
"text-center"
>
{{ user.email }}
</td>
<td
class=
"text-center"
>
{{ user.is_active|bool2str }}
</td>
<td
class=
"text-center"
>
<a
href=
"../user_detail/?username={{ user.username }}
/
"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"../user_detail/?username={{ user.username }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<a
href=
"../user_edit/?username={{ user.username }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
href=
"../user_del/?username={{ user.username }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
...
...
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