Merge pull request #1224 from jumpserver/dev

Dev
pull/2666/head
老广 2018-04-20 11:36:16 +08:00 committed by GitHub
commit e865484a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 80 additions and 80 deletions

View File

@ -31,7 +31,7 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-9 col-lg-9 col-sm-offset-2"> <div class="col-sm-9 col-lg-9 col-sm-offset-2">
<div class="checkbox checkbox-success"> <div class="checkbox checkbox-success">
<input type="checkbox" name="enable_otp" checked id="id_enable_otp"><label for="id_enable_otp">{% trans 'Enable-OTP' %}</label> <input type="checkbox" name="enable_otp" checked id="id_enable_otp"><label for="id_enable_otp">{% trans 'Enable-MFA' %}</label>
</div> </div>
</div> </div>
</div> </div>

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n" "Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-19 17:48+0800\n" "POT-Creation-Date: 2018-04-20 11:17+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n" "Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n" "Language-Team: Jumpserver team<ibuler@qq.com>\n"
@ -346,7 +346,7 @@ msgstr "创建日期"
#: users/models/user.py:52 users/templates/users/user_detail.html:119 #: users/models/user.py:52 users/templates/users/user_detail.html:119
#: users/templates/users/user_group_detail.html:67 #: users/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_list.html:14 #: users/templates/users/user_group_list.html:14
#: users/templates/users/user_profile.html:122 #: users/templates/users/user_profile.html:123
msgid "Comment" msgid "Comment"
msgstr "备注" msgstr "备注"
@ -561,8 +561,9 @@ msgid "Select System Users"
msgstr "选择系统用户" msgstr "选择系统用户"
#: assets/templates/assets/_asset_group_bulk_update_modal.html:34 #: assets/templates/assets/_asset_group_bulk_update_modal.html:34
msgid "Enable-OTP" #, fuzzy
msgstr "二次验证" msgid "Enable-MFA"
msgstr "启用MFA"
#: assets/templates/assets/_asset_import_modal.html:4 #: assets/templates/assets/_asset_import_modal.html:4
msgid "Import asset" msgid "Import asset"
@ -639,7 +640,7 @@ msgstr "其它"
#: users/templates/users/_user.html:43 #: users/templates/users/_user.html:43
#: users/templates/users/user_bulk_update.html:23 #: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_password_update.html:58 #: users/templates/users/user_password_update.html:58
#: users/templates/users/user_profile.html:180 #: users/templates/users/user_profile.html:181
#: users/templates/users/user_profile_update.html:63 #: users/templates/users/user_profile_update.html:63
#: users/templates/users/user_pubkey_update.html:70 #: users/templates/users/user_pubkey_update.html:70
#: users/templates/users/user_pubkey_update.html:76 #: users/templates/users/user_pubkey_update.html:76
@ -745,8 +746,8 @@ msgstr "测试"
#: users/templates/users/user_group_detail.html:28 #: users/templates/users/user_group_detail.html:28
#: users/templates/users/user_group_list.html:43 #: users/templates/users/user_group_list.html:43
#: users/templates/users/user_list.html:76 #: users/templates/users/user_list.html:76
#: users/templates/users/user_profile.html:143 #: users/templates/users/user_profile.html:144
#: users/templates/users/user_profile.html:172 #: users/templates/users/user_profile.html:173
msgid "Update" msgid "Update"
msgstr "更新" msgstr "更新"
@ -794,7 +795,7 @@ msgstr "选择节点"
#: users/templates/users/user_group_create_update.html:32 #: users/templates/users/user_group_create_update.html:32
#: users/templates/users/user_group_list.html:86 #: users/templates/users/user_group_list.html:86
#: users/templates/users/user_list.html:196 #: users/templates/users/user_list.html:196
#: users/templates/users/user_profile.html:214 #: users/templates/users/user_profile.html:215
msgid "Confirm" msgid "Confirm"
msgstr "确认" msgstr "确认"
@ -845,14 +846,14 @@ msgstr "硬盘"
#: assets/templates/assets/asset_detail.html:121 #: assets/templates/assets/asset_detail.html:121
#: users/templates/users/user_detail.html:111 #: users/templates/users/user_detail.html:111
#: users/templates/users/user_profile.html:96 #: users/templates/users/user_profile.html:97
msgid "Date joined" msgid "Date joined"
msgstr "创建日期" msgstr "创建日期"
#: assets/templates/assets/asset_detail.html:137 #: assets/templates/assets/asset_detail.html:137
#: terminal/templates/terminal/session_detail.html:81 #: terminal/templates/terminal/session_detail.html:81
#: users/templates/users/user_detail.html:130 #: users/templates/users/user_detail.html:130
#: users/templates/users/user_profile.html:134 #: users/templates/users/user_profile.html:135
msgid "Quick modify" msgid "Quick modify"
msgstr "快速修改" msgstr "快速修改"
@ -1730,7 +1731,7 @@ msgstr ""
#: perms/models.py:27 perms/models.py:71 #: perms/models.py:27 perms/models.py:71
#: perms/templates/perms/asset_permission_detail.html:90 #: perms/templates/perms/asset_permission_detail.html:90
#: users/models/user.py:54 users/templates/users/user_detail.html:103 #: users/models/user.py:54 users/templates/users/user_detail.html:103
#: users/templates/users/user_profile.html:104 #: users/templates/users/user_profile.html:105
msgid "Date expired" msgid "Date expired"
msgstr "失效日期" msgstr "失效日期"
@ -2229,7 +2230,7 @@ msgid "Invalid token or cache refreshed."
msgstr "" msgstr ""
#: users/forms.py:30 #: users/forms.py:30
msgid "Otp_code" msgid "MFA_code"
msgstr "" msgstr ""
#: users/forms.py:39 users/models/user.py:43 #: users/forms.py:39 users/models/user.py:43
@ -2290,7 +2291,7 @@ msgstr "复制你的公钥到这里"
#: users/forms.py:181 users/models/user.py:51 #: users/forms.py:181 users/models/user.py:51
#: users/templates/users/user_password_update.html:43 #: users/templates/users/user_password_update.html:43
#: users/templates/users/user_profile.html:79 #: users/templates/users/user_profile.html:68
#: users/templates/users/user_profile_update.html:43 #: users/templates/users/user_profile_update.html:43
#: users/templates/users/user_pubkey_update.html:43 #: users/templates/users/user_pubkey_update.html:43
msgid "Public key" msgid "Public key"
@ -2328,18 +2329,18 @@ msgstr "管理员"
msgid "Application" msgid "Application"
msgstr "应用程序" msgstr "应用程序"
#: users/models/user.py:34 users/templates/users/user_profile.html:74 #: users/models/user.py:34 users/templates/users/user_profile.html:92
#: users/templates/users/user_profile.html:155 #: users/templates/users/user_profile.html:156
#: users/templates/users/user_profile.html:158 #: users/templates/users/user_profile.html:159
msgid "Disable" msgid "Disable"
msgstr "禁用" msgstr "禁用"
#: users/models/user.py:35 users/templates/users/user_profile.html:72 #: users/models/user.py:35 users/templates/users/user_profile.html:90
#: users/templates/users/user_profile.html:162 #: users/templates/users/user_profile.html:163
msgid "Enable" msgid "Enable"
msgstr "启用" msgstr "启用"
#: users/models/user.py:36 users/templates/users/user_profile.html:70 #: users/models/user.py:36 users/templates/users/user_profile.html:88
msgid "Force enable" msgid "Force enable"
msgstr "强制启用" msgstr "强制启用"
@ -2356,7 +2357,7 @@ msgstr "头像"
msgid "Wechat" msgid "Wechat"
msgstr "微信" msgstr "微信"
#: users/models/user.py:47 users/templates/users/user_detail.html:91 #: users/models/user.py:47
msgid "Enable OTP" msgid "Enable OTP"
msgstr "二次验证" msgstr "二次验证"
@ -2457,8 +2458,10 @@ msgid "City"
msgstr "城市" msgstr "城市"
#: users/templates/users/login_otp.html:45 #: users/templates/users/login_otp.html:45
msgid "二次认证" #: users/templates/users/user_detail.html:91
msgstr "" #: users/templates/users/user_profile.html:85
msgid "MFA certification"
msgstr "MFA认证"
#: users/templates/users/login_otp.html:64 #: users/templates/users/login_otp.html:64
#: users/templates/users/user_otp_authentication.html:19 #: users/templates/users/user_otp_authentication.html:19
@ -2468,7 +2471,7 @@ msgstr "6位数字"
#: users/templates/users/login_otp.html:69 #: users/templates/users/login_otp.html:69
msgid "Can't provide security? Please contact the administrator!" msgid "Can't provide security? Please contact the administrator!"
msgstr "如果不能提供OTP验证码,请联系管理员!" msgstr "如果不能提供MFA验证码,请联系管理员!"
#: users/templates/users/reset_password.html:45 #: users/templates/users/reset_password.html:45
#: users/templates/users/user_detail.html:348 users/utils.py:73 #: users/templates/users/user_detail.html:348 users/utils.py:73
@ -2514,13 +2517,13 @@ msgid "Disabled"
msgstr "禁用" msgstr "禁用"
#: users/templates/users/user_detail.html:115 #: users/templates/users/user_detail.html:115
#: users/templates/users/user_profile.html:100 #: users/templates/users/user_profile.html:101
msgid "Last login" msgid "Last login"
msgstr "最后登录" msgstr "最后登录"
#: users/templates/users/user_detail.html:151 #: users/templates/users/user_detail.html:151
msgid "Force enabled OTP" msgid "Force enabled MFA"
msgstr "强制启用OTP" msgstr "强制启用MFA"
#: users/templates/users/user_detail.html:166 #: users/templates/users/user_detail.html:166
msgid "Send reset password mail" msgid "Send reset password mail"
@ -2536,8 +2539,8 @@ msgid "Send reset ssh key mail"
msgstr "发送重置密钥邮件" msgstr "发送重置密钥邮件"
#: users/templates/users/user_detail.html:291 #: users/templates/users/user_detail.html:291
msgid "Goto profile page enable otp" msgid "Goto profile page enable MFA"
msgstr "请去个人信息页面启用自己的OTP" msgstr "请去个人信息页面启用自己的MFA"
#: users/templates/users/user_detail.html:347 #: users/templates/users/user_detail.html:347
msgid "An e-mail has been sent to the user`s mailbox." msgid "An e-mail has been sent to the user`s mailbox."
@ -2562,14 +2565,14 @@ msgid "This will reset the user public key and send a reset mail"
msgstr "将会失效用户当前密钥,并发送重置邮件到用户邮箱" msgstr "将会失效用户当前密钥,并发送重置邮件到用户邮箱"
#: users/templates/users/user_detail.html:400 #: users/templates/users/user_detail.html:400
#: users/templates/users/user_profile.html:203 #: users/templates/users/user_profile.html:204
msgid "Successfully updated the SSH public key." msgid "Successfully updated the SSH public key."
msgstr "更新ssh密钥成功" msgstr "更新ssh密钥成功"
#: users/templates/users/user_detail.html:401 #: users/templates/users/user_detail.html:401
#: users/templates/users/user_detail.html:405 #: users/templates/users/user_detail.html:405
#: users/templates/users/user_profile.html:204 #: users/templates/users/user_profile.html:205
#: users/templates/users/user_profile.html:209 #: users/templates/users/user_profile.html:210
msgid "User SSH public key update" msgid "User SSH public key update"
msgstr "ssh密钥" msgstr "ssh密钥"
@ -2625,32 +2628,28 @@ msgstr "删除"
msgid "User Deleting failed." msgid "User Deleting failed."
msgstr "用户删除失败" msgstr "用户删除失败"
#: users/templates/users/user_profile.html:67 #: users/templates/users/user_profile.html:109 users/views/user.py:185
msgid "OTP"
msgstr ""
#: users/templates/users/user_profile.html:108 users/views/user.py:185
#: users/views/user.py:239 #: users/views/user.py:239
msgid "User groups" msgid "User groups"
msgstr "用户组" msgstr "用户组"
#: users/templates/users/user_profile.html:140 #: users/templates/users/user_profile.html:141
msgid "Update password" msgid "Update password"
msgstr "更改密码" msgstr "更改密码"
#: users/templates/users/user_profile.html:148 #: users/templates/users/user_profile.html:149
msgid "Update otp" msgid "Update MFA settings"
msgstr "更改OTP设置" msgstr "更改MFA设置"
#: users/templates/users/user_profile.html:169 #: users/templates/users/user_profile.html:170
msgid "Update SSH public key" msgid "Update SSH public key"
msgstr "更改SSH密钥" msgstr "更改SSH密钥"
#: users/templates/users/user_profile.html:177 #: users/templates/users/user_profile.html:178
msgid "Reset public key and download" msgid "Reset public key and download"
msgstr "重置并下载SSH密钥" msgstr "重置并下载SSH密钥"
#: users/templates/users/user_profile.html:207 #: users/templates/users/user_profile.html:208
msgid "Failed to update SSH public key." msgid "Failed to update SSH public key."
msgstr "更新密钥失败" msgstr "更新密钥失败"
@ -2821,8 +2820,8 @@ msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie" msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:107 users/views/user.py:464 users/views/user.py:489 #: users/views/login.py:107 users/views/user.py:464 users/views/user.py:489
msgid "Otp code invalid" msgid "MFA code invalid"
msgstr "otp码认证失败" msgstr "MFA码认证失败"
#: users/views/login.py:133 #: users/views/login.py:133
msgid "Logout success" msgid "Logout success"
@ -2898,20 +2897,20 @@ msgid "Password invalid"
msgstr "用户名或密码无效" msgstr "用户名或密码无效"
#: users/views/user.py:515 #: users/views/user.py:515
msgid "OTP enable success" msgid "MFA enable success"
msgstr "OTP 绑定成功" msgstr "MFA 绑定成功"
#: users/views/user.py:516 #: users/views/user.py:516
msgid "OTP enable success, return login page" msgid "MFA enable success, return login page"
msgstr "OTP 绑定成功,返回到登录页面" msgstr "MFA 绑定成功,返回到登录页面"
#: users/views/user.py:518 #: users/views/user.py:518
msgid "OTP disable success" msgid "MFA disable success"
msgstr "OTP 解绑成功" msgstr "MFA 解绑成功"
#: users/views/user.py:519 #: users/views/user.py:519
msgid "OTP disable success, return login page" msgid "MFA disable success, return login page"
msgstr "OTP 解绑成功,返回登录页面" msgstr "MFA 解绑成功,返回登录页面"
#~ msgid "Add asset" #~ msgid "Add asset"
#~ msgstr "添加资产到节点" #~ msgstr "添加资产到节点"

View File

@ -27,7 +27,7 @@ class UserCheckPasswordForm(forms.Form):
class UserCheckOtpCodeForm(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): class UserCreateUpdateForm(forms.ModelForm):

View File

@ -54,7 +54,7 @@
<i class="iconfont icon-step1"></i> <i class="iconfont icon-step1"></i>
<span></span> <span></span>
</div> </div>
<div class="back">绑定TOTP</div> <div class="back">绑定MFA</div>
</li> </li>
<li> <li>
<div> <div>

View File

@ -42,7 +42,7 @@
<div class="ibox-content"> <div class="ibox-content">
<div> <div>
<img src="{% static 'img/logo.png' %}" width="60" height="60"> <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>
<div class="m-t"> <div class="m-t">

View File

@ -88,7 +88,7 @@
<td><b>{{ user_object.get_role_display }}</b></td> <td><b>{{ user_object.get_role_display }}</b></td>
</tr> </tr>
<tr> <tr>
<td>{% trans 'Enable OTP' %}:</td> <td>{% trans 'MFA certification' %}:</td>
<td><b> <td><b>
{% if user_object.otp_force_enabled %} {% if user_object.otp_force_enabled %}
{% trans 'Force enabled' %} {% trans 'Force enabled' %}
@ -148,7 +148,7 @@
</tr> </tr>
<tr> <tr>
<td>{% trans 'Force enabled OTP' %}:</td> <td>{% trans 'Force enabled MFA' %}:</td>
<td><span class="pull-right"> <td><span class="pull-right">
<div class="switch"> <div class="switch">
<div class="onoffswitch"> <div class="onoffswitch">
@ -288,7 +288,7 @@ $(document).ready(function() {
}) })
.on('click', '#force_enable_otp', function() { .on('click', '#force_enable_otp', function() {
{% if request.user == user_object %} {% if request.user == user_object %}
toastr.error("{% trans 'Goto profile page enable otp' %}"); toastr.error("{% trans 'Goto profile page enable MFA' %}");
return return
{% endif %} {% endif %}

View File

@ -63,18 +63,7 @@
<td class="text-navy">{% trans 'Active' %}</td> <td class="text-navy">{% trans 'Active' %}</td>
<td>{{ user.is_active|yesno:"Yes,No,Unkown" }}</td> <td>{{ user.is_active|yesno:"Yes,No,Unkown" }}</td>
</tr> </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> <tr>
<td class="text-navy">{% trans 'Public key' %}</td> <td class="text-navy">{% trans 'Public key' %}</td>
<td> <td>
@ -92,6 +81,18 @@
</table> </table>
</td> </td>
</tr> </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> <tr>
<td class="text-navy">{% trans 'Date joined' %}</td> <td class="text-navy">{% trans 'Date joined' %}</td>
<td>{{ user.date_joined|date:"Y-m-d H:i:s" }}</td> <td>{{ user.date_joined|date:"Y-m-d H:i:s" }}</td>
@ -145,7 +146,7 @@
</td> </td>
</tr> </tr>
<tr class="no-borders-tr"> <tr class="no-borders-tr">
<td>{% trans 'Update otp' %}:</td> <td>{% trans 'Update MFA settings' %}:</td>
<td> <td>
<span class="pull-right"> <span class="pull-right">
<a type="button" class="btn btn-primary btn-xs" style="width: 54px" id="" <a type="button" class="btn btn-primary btn-xs" style="width: 54px" id=""

View File

@ -104,7 +104,7 @@ class UserLoginOtpView(FormView):
self.write_login_log() self.write_login_log()
return redirect(self.get_success_url()) return redirect(self.get_success_url())
else: else:
form.add_error('otp_code', _('Otp code invalid')) form.add_error('otp_code', _('MFA code invalid'))
return super().form_invalid(form) return super().form_invalid(form)
def get_success_url(self): def get_success_url(self):

View File

@ -461,7 +461,7 @@ class UserOtpEnableBindView(TemplateView, FormView):
return super().form_valid(form) return super().form_valid(form)
else: else:
form.add_error("otp_code", _("Otp code invalid")) form.add_error("otp_code", _("MFA code invalid"))
return self.form_invalid(form) return self.form_invalid(form)
def save_otp(self, otp_secret_key): def save_otp(self, otp_secret_key):
@ -486,7 +486,7 @@ class UserOtpDisableAuthenticationView(FormView):
user.save() user.save()
return super().form_valid(form) return super().form_valid(form)
else: else:
form.add_error('otp_code', _('Otp code invalid')) form.add_error('otp_code', _('MFA code invalid'))
return super().form_invalid(form) return super().form_invalid(form)
@ -512,10 +512,10 @@ class UserOtpSettingsSuccessView(TemplateView):
user = get_user_or_tmp_user(self.request) user = get_user_or_tmp_user(self.request)
if self.request.user.is_authenticated: if self.request.user.is_authenticated:
auth_logout(self.request) auth_logout(self.request)
title = _('OTP enable success') title = _('MFA enable success')
describe = _('OTP enable success, return login page') describe = _('MFA enable success, return login page')
if not user.otp_enabled: if not user.otp_enabled:
title = _('OTP disable success') title = _('MFA disable success')
describe = _('OTP disable success, return login page') describe = _('MFA disable success, return login page')
return title, describe return title, describe