Commit 11f0024c authored by ibuler's avatar ibuler

[Update] 添加登录复核开关

parent dc3a9561
......@@ -7,7 +7,10 @@ from django.utils.translation import ugettext_lazy as _
ENV_PERIOD_TASK = os.environ.get("PERIOD_TASK", "on") == 'on'
PERIOD_TASK_ENABLED = settings.PERIOD_TASK_ENABLED and ENV_PERIOD_TASK
ENV_PERIOD_TASK_ENABLED = os.environ.get("PERIOD_TASK_ENABLED", "on") == "on"
PERIOD_TASK_ENABLED = settings.CONFIG.PERIOD_TASK_ENABLE \
and ENV_PERIOD_TASK \
and ENV_PERIOD_TASK_ENABLED
UPDATE_ASSETS_HARDWARE_TASKS = [
{
......
......@@ -394,8 +394,9 @@ defaults = {
'WINDOWS_SSH_DEFAULT_SHELL': 'cmd',
'FLOWER_URL': "127.0.0.1:5555",
'DEFAULT_ORG_SHOW_ALL_USERS': True,
'PERIOD_TASK_ENABLED': True,
'PERIOD_TASK_ENABLE': True,
'FORCE_SCRIPT_NAME': '',
'LOGIN_CONFIRM_ENABLE': False
}
......
......@@ -20,6 +20,7 @@ def jumpserver_processor(request):
'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL,
'FORCE_SCRIPT_NAME': settings.FORCE_SCRIPT_NAME,
'SECURITY_VIEW_AUTH_NEED_MFA': settings.CONFIG.SECURITY_VIEW_AUTH_NEED_MFA,
'LOGIN_CONFIRM_ENABLE': settings.CONFIG.LOGIN_CONFIRM_ENABLE,
}
return context
......
......@@ -121,7 +121,7 @@
</li>
{% endif %}
{% if request.user.can_admin_current_org %}
{% if request.user.can_admin_current_org and LOGIN_CONFIRM_ENABLE %}
<li id="orders">
<a>
<i class="fa fa-check-square-o" style="width: 14px"></i> <span class="nav-label">{% trans 'Orders' %}</span><span class="fa arrow"></span>
......
......@@ -212,7 +212,6 @@
</table>
</div>
</div>
{% if user_object.is_current_org_admin or user_object.is_superuser %}
<div class="panel panel-info">
<div class="panel-heading">
......@@ -252,7 +251,7 @@
</table>
</div>
</div>
{% endif %}
{% if LOGIN_CONFIRM_ENABLE %}
<div class="panel panel-warning">
<div class="panel-heading">
<i class="fa fa-info-circle"></i> {% trans 'Login confirm' %}
......@@ -289,6 +288,8 @@
</table>
</div>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment