mirror of https://github.com/jumpserver/jumpserver
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
commit
c706a410a2
|
@ -174,10 +174,11 @@ function initTable() {
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
{targets: 8, createdCell: function (td, cellData, rowData) {
|
{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 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>'
|
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('{{ DEFAULT_PK }}', cellData)
|
||||||
.replace('99991938', rowData.name);
|
.replace('99991938', name);
|
||||||
if (rowData.inherit) {
|
if (rowData.inherit) {
|
||||||
del_btn = del_btn.replace("mark", "disabled")
|
del_btn = del_btn.replace("mark", "disabled")
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,16 +69,17 @@ function initTable() {
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
{targets: 6, createdCell: function (td, cellData, rowData) {
|
{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>'
|
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);
|
.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>'
|
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('{{ 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> '
|
var accept_btn = '<a class="btn btn-xs btn-primary btn-accept" data-id="{{ DEFAULT_PK }}">{% trans "Accept" %}</a> '
|
||||||
.replace('{{ DEFAULT_PK }}', cellData);
|
.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>'
|
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('{{ DEFAULT_PK }}', cellData)
|
||||||
.replace('99991938', rowData.name);
|
.replace('99991938', name);
|
||||||
if (rowData.is_accepted) {
|
if (rowData.is_accepted) {
|
||||||
$(td).html(update_btn + delete_btn);
|
$(td).html(update_btn + delete_btn);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -111,7 +111,7 @@ class AuthMixin:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def password_will_expired(self):
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,13 @@ logger = get_logger(__file__)
|
||||||
def check_password_expired():
|
def check_password_expired():
|
||||||
users = User.objects.exclude(role=User.ROLE_APP)
|
users = User.objects.exclude(role=User.ROLE_APP)
|
||||||
for user in users:
|
for user in users:
|
||||||
|
if not user.is_valid:
|
||||||
|
continue
|
||||||
if not user.password_will_expired:
|
if not user.password_will_expired:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
send_password_expiration_reminder_mail(user)
|
send_password_expiration_reminder_mail(user)
|
||||||
logger.info("The user {} password expires in {} days".format(
|
msg = "The user {} password expires in {} days"
|
||||||
user, user.password_expired_remain_days)
|
logger.info(msg.format(user, user.password_expired_remain_days))
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
|
|
|
@ -67,11 +67,12 @@ function initTable() {
|
||||||
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
|
$(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');
|
||||||
}},
|
}},
|
||||||
{targets: 4, createdCell: function (td, cellData, rowData) {
|
{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>'
|
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);
|
.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>'
|
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('{{ DEFAULT_PK }}', cellData)
|
||||||
.replace('99991938', rowData.name);
|
.replace('99991938', name);
|
||||||
if (rowData.id === 1) {
|
if (rowData.id === 1) {
|
||||||
$(td).html(update_btn)
|
$(td).html(update_btn)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -97,6 +97,7 @@ function initTable() {
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
{targets: 7, createdCell: function (td, cellData, rowData) {
|
{targets: 7, createdCell: function (td, cellData, rowData) {
|
||||||
|
var name = htmlEscape(rowData.name);
|
||||||
var update_btn = "";
|
var update_btn = "";
|
||||||
if (rowData.role === 'Admin' && ('{{ request.user.role }}' !== 'Admin')) {
|
if (rowData.role === 'Admin' && ('{{ request.user.role }}' !== 'Admin')) {
|
||||||
update_btn = '<a class="btn btn-xs disabled btn-info">{% trans "Update" %}</a>';
|
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'))) {
|
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>'
|
del_btn = '<a class="btn btn-xs btn-danger m-l-xs" disabled>{% trans "Delete" %}</a>'
|
||||||
.replace('{{ DEFAULT_PK }}', cellData)
|
.replace('{{ DEFAULT_PK }}', cellData)
|
||||||
.replace('99991938', rowData.name);
|
.replace('99991938', name);
|
||||||
} else {
|
} 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>'
|
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('{{ DEFAULT_PK }}', cellData)
|
||||||
.replace('99991938', rowData.name);
|
.replace('99991938', name);
|
||||||
}
|
}
|
||||||
$(td).html(update_btn + del_btn)
|
$(td).html(update_btn + del_btn)
|
||||||
}}],
|
}}],
|
||||||
|
|
Loading…
Reference in New Issue