mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 00:09:14 +00:00
[Update] OTP文案修改为MFA
This commit is contained in:
@@ -27,7 +27,7 @@ class UserCheckPasswordForm(forms.Form):
|
||||
|
||||
|
||||
class UserCheckOtpCodeForm(forms.Form):
|
||||
otp_code = forms.CharField(label=_('Otp_code'), max_length=6)
|
||||
otp_code = forms.CharField(label=_('MFA_code'), max_length=6)
|
||||
|
||||
|
||||
class UserCreateUpdateForm(forms.ModelForm):
|
||||
|
@@ -54,7 +54,7 @@
|
||||
<i class="iconfont icon-step1"></i>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="back">绑定TOTP</div>
|
||||
<div class="back">绑定MFA</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
|
@@ -42,7 +42,7 @@
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<img src="{% static 'img/logo.png' %}" width="60" height="60">
|
||||
<span class="font-bold text-center" style="font-size: 24px; font-family: inherit; margin-left: 20px">{% trans '二次认证' %}</span>
|
||||
<span class="font-bold text-center" style="font-size: 24px; font-family: inherit; margin-left: 20px">{% trans 'MFA certification' %}</span>
|
||||
</div>
|
||||
<div class="m-t">
|
||||
|
||||
|
@@ -88,7 +88,7 @@
|
||||
<td><b>{{ user_object.get_role_display }}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Enable OTP' %}:</td>
|
||||
<td>{% trans 'MFA certification' %}:</td>
|
||||
<td><b>
|
||||
{% if user_object.otp_force_enabled %}
|
||||
{% trans 'Force enabled' %}
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Force enabled OTP' %}:</td>
|
||||
<td>{% trans 'Force enabled MFA' %}:</td>
|
||||
<td><span class="pull-right">
|
||||
<div class="switch">
|
||||
<div class="onoffswitch">
|
||||
@@ -288,7 +288,7 @@ $(document).ready(function() {
|
||||
})
|
||||
.on('click', '#force_enable_otp', function() {
|
||||
{% if request.user == user_object %}
|
||||
toastr.error("{% trans 'Goto profile page enable otp' %}");
|
||||
toastr.error("{% trans 'Goto profile page enable MFA' %}");
|
||||
return
|
||||
{% endif %}
|
||||
|
||||
|
@@ -63,18 +63,7 @@
|
||||
<td class="text-navy">{% trans 'Active' %}</td>
|
||||
<td>{{ user.is_active|yesno:"Yes,No,Unkown" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-navy">{% trans 'OTP' %}</td>
|
||||
<td>
|
||||
{% if user.otp_force_enabled %}
|
||||
{% trans 'Force enable' %}
|
||||
{% elif user.otp_enabled%}
|
||||
{% trans 'Enable' %}
|
||||
{% else %}
|
||||
{% trans 'Disable' %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="text-navy">{% trans 'Public key' %}</td>
|
||||
<td>
|
||||
@@ -92,6 +81,18 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-navy">{% trans 'MFA certification' %}</td>
|
||||
<td>
|
||||
{% if user.otp_force_enabled %}
|
||||
{% trans 'Force enable' %}
|
||||
{% elif user.otp_enabled%}
|
||||
{% trans 'Enable' %}
|
||||
{% else %}
|
||||
{% trans 'Disable' %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-navy">{% trans 'Date joined' %}</td>
|
||||
<td>{{ user.date_joined|date:"Y-m-d H:i:s" }}</td>
|
||||
@@ -145,7 +146,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="no-borders-tr">
|
||||
<td>{% trans 'Update otp' %}:</td>
|
||||
<td>{% trans 'Update MFA settings' %}:</td>
|
||||
<td>
|
||||
<span class="pull-right">
|
||||
<a type="button" class="btn btn-primary btn-xs" style="width: 54px" id=""
|
||||
|
@@ -104,7 +104,7 @@ class UserLoginOtpView(FormView):
|
||||
self.write_login_log()
|
||||
return redirect(self.get_success_url())
|
||||
else:
|
||||
form.add_error('otp_code', _('Otp code invalid'))
|
||||
form.add_error('otp_code', _('MFA code invalid'))
|
||||
return super().form_invalid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
|
@@ -461,7 +461,7 @@ class UserOtpEnableBindView(TemplateView, FormView):
|
||||
return super().form_valid(form)
|
||||
|
||||
else:
|
||||
form.add_error("otp_code", _("Otp code invalid"))
|
||||
form.add_error("otp_code", _("MFA code invalid"))
|
||||
return self.form_invalid(form)
|
||||
|
||||
def save_otp(self, otp_secret_key):
|
||||
@@ -486,7 +486,7 @@ class UserOtpDisableAuthenticationView(FormView):
|
||||
user.save()
|
||||
return super().form_valid(form)
|
||||
else:
|
||||
form.add_error('otp_code', _('Otp code invalid'))
|
||||
form.add_error('otp_code', _('MFA code invalid'))
|
||||
return super().form_invalid(form)
|
||||
|
||||
|
||||
@@ -512,10 +512,10 @@ class UserOtpSettingsSuccessView(TemplateView):
|
||||
user = get_user_or_tmp_user(self.request)
|
||||
if self.request.user.is_authenticated:
|
||||
auth_logout(self.request)
|
||||
title = _('OTP enable success')
|
||||
describe = _('OTP enable success, return login page')
|
||||
title = _('MFA enable success')
|
||||
describe = _('MFA enable success, return login page')
|
||||
if not user.otp_enabled:
|
||||
title = _('OTP disable success')
|
||||
describe = _('OTP disable success, return login page')
|
||||
title = _('MFA disable success')
|
||||
describe = _('MFA disable success, return login page')
|
||||
|
||||
return title, describe
|
||||
|
Reference in New Issue
Block a user