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
c706a410
Commit
c706a410
authored
Jul 30, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
d0c74a77
32dacecd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
11 deletions
+15
-11
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+2
-1
terminal_list.html
apps/terminal/templates/terminal/terminal_list.html
+3
-2
user.py
apps/users/models/user.py
+1
-1
tasks.py
apps/users/tasks.py
+4
-4
user_group_list.html
apps/users/templates/users/user_group_list.html
+2
-1
user_list.html
apps/users/templates/users/user_list.html
+3
-2
No files found.
apps/perms/templates/perms/asset_permission_list.html
View file @
c706a410
...
...
@@ -174,10 +174,11 @@ function initTable() {
}
}},
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "perms:asset-permission-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-uid="{{ DEFAULT_PK }}" mark=1 data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
inherit
)
{
del_btn
=
del_btn
.
replace
(
"mark"
,
"disabled"
)
}
...
...
apps/terminal/templates/terminal/terminal_list.html
View file @
c706a410
...
...
@@ -69,16 +69,17 @@ function initTable() {
}
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "terminal:terminal-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
delete_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
var
accept_btn
=
'<a class="btn btn-xs btn-primary btn-accept" data-id="{{ DEFAULT_PK }}">{% trans "Accept" %}</a> '
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
reject_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Reject" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
is_accepted
)
{
$
(
td
).
html
(
update_btn
+
delete_btn
);
}
else
{
...
...
apps/users/models/user.py
View file @
c706a410
...
...
@@ -111,7 +111,7 @@ class AuthMixin:
@property
def
password_will_expired
(
self
):
if
self
.
is_local
and
self
.
password_expired_remain_days
<
5
:
if
self
.
is_local
and
0
<=
self
.
password_expired_remain_days
<
5
:
return
True
return
False
...
...
apps/users/tasks.py
View file @
c706a410
...
...
@@ -20,13 +20,13 @@ logger = get_logger(__file__)
def
check_password_expired
():
users
=
User
.
objects
.
exclude
(
role
=
User
.
ROLE_APP
)
for
user
in
users
:
if
not
user
.
is_valid
:
continue
if
not
user
.
password_will_expired
:
continue
send_password_expiration_reminder_mail
(
user
)
logger
.
info
(
"The user {} password expires in {} days"
.
format
(
user
,
user
.
password_expired_remain_days
)
)
msg
=
"The user {} password expires in {} days"
logger
.
info
(
msg
.
format
(
user
,
user
.
password_expired_remain_days
))
@shared_task
...
...
apps/users/templates/users/user_group_list.html
View file @
c706a410
...
...
@@ -67,11 +67,12 @@ function initTable() {
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "users:user-group-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_delete_user_group" data-gid="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
id
===
1
)
{
$
(
td
).
html
(
update_btn
)
}
else
{
...
...
apps/users/templates/users/user_list.html
View file @
c706a410
...
...
@@ -97,6 +97,7 @@ function initTable() {
}
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
""
;
if
(
rowData
.
role
===
'Admin'
&&
(
'{{ request.user.role }}'
!==
'Admin'
))
{
update_btn
=
'<a class="btn btn-xs disabled btn-info">{% trans "Update" %}</a>'
;
...
...
@@ -109,11 +110,11 @@ function initTable() {
if
(
rowData
.
id
===
1
||
rowData
.
username
===
"admin"
||
rowData
.
username
===
"{{ request.user.username }}"
||
(
rowData
.
role
===
'Admin'
&&
(
'{{ request.user.role }}'
!==
'Admin'
)))
{
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs" disabled>{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
}
else
{
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_user_delete" data-uid="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
}
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
...
...
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