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
7a219e17
Commit
7a219e17
authored
Apr 20, 2018
by
BaiJiangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] OTP文案修改为MFA
parent
9ac7f26c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
80 deletions
+80
-80
_asset_group_bulk_update_modal.html
...sets/templates/assets/_asset_group_bulk_update_modal.html
+1
-1
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+52
-53
forms.py
apps/users/forms.py
+1
-1
_base_otp.html
apps/users/templates/users/_base_otp.html
+1
-1
login_otp.html
apps/users/templates/users/login_otp.html
+1
-1
user_detail.html
apps/users/templates/users/user_detail.html
+3
-3
user_profile.html
apps/users/templates/users/user_profile.html
+14
-13
login.py
apps/users/views/login.py
+1
-1
user.py
apps/users/views/user.py
+6
-6
No files found.
apps/assets/templates/assets/_asset_group_bulk_update_modal.html
View file @
7a219e17
...
...
@@ -31,7 +31,7 @@
<div
class=
"form-group"
>
<div
class=
"col-sm-9 col-lg-9 col-sm-offset-2"
>
<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>
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
7a219e17
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
7a219e17
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\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"
"Last-Translator: ibuler <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/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_list.html:14
#: users/templates/users/user_profile.html:12
2
#: users/templates/users/user_profile.html:12
3
msgid "Comment"
msgstr "备注"
...
...
@@ -561,8 +561,9 @@ msgid "Select System Users"
msgstr "选择系统用户"
#: assets/templates/assets/_asset_group_bulk_update_modal.html:34
msgid "Enable-OTP"
msgstr "二次验证"
#, fuzzy
msgid "Enable-MFA"
msgstr "启用MFA"
#: assets/templates/assets/_asset_import_modal.html:4
msgid "Import asset"
...
...
@@ -639,7 +640,7 @@ msgstr "其它"
#: users/templates/users/_user.html:43
#: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_password_update.html:58
#: users/templates/users/user_profile.html:18
0
#: users/templates/users/user_profile.html:18
1
#: users/templates/users/user_profile_update.html:63
#: users/templates/users/user_pubkey_update.html:70
#: 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_list.html:43
#: users/templates/users/user_list.html:76
#: users/templates/users/user_profile.html:14
3
#: users/templates/users/user_profile.html:17
2
#: users/templates/users/user_profile.html:14
4
#: users/templates/users/user_profile.html:17
3
msgid "Update"
msgstr "更新"
...
...
@@ -794,7 +795,7 @@ msgstr "选择节点"
#: users/templates/users/user_group_create_update.html:32
#: users/templates/users/user_group_list.html:86
#: users/templates/users/user_list.html:196
#: users/templates/users/user_profile.html:21
4
#: users/templates/users/user_profile.html:21
5
msgid "Confirm"
msgstr "确认"
...
...
@@ -845,14 +846,14 @@ msgstr "硬盘"
#: assets/templates/assets/asset_detail.html:121
#: users/templates/users/user_detail.html:111
#: users/templates/users/user_profile.html:9
6
#: users/templates/users/user_profile.html:9
7
msgid "Date joined"
msgstr "创建日期"
#: assets/templates/assets/asset_detail.html:137
#: terminal/templates/terminal/session_detail.html:81
#: users/templates/users/user_detail.html:130
#: users/templates/users/user_profile.html:13
4
#: users/templates/users/user_profile.html:13
5
msgid "Quick modify"
msgstr "快速修改"
...
...
@@ -1730,7 +1731,7 @@ msgstr ""
#: perms/models.py:27 perms/models.py:71
#: perms/templates/perms/asset_permission_detail.html:90
#: users/models/user.py:54 users/templates/users/user_detail.html:103
#: users/templates/users/user_profile.html:10
4
#: users/templates/users/user_profile.html:10
5
msgid "Date expired"
msgstr "失效日期"
...
...
@@ -2229,7 +2230,7 @@ msgid "Invalid token or cache refreshed."
msgstr ""
#: users/forms.py:30
msgid "
Otp
_code"
msgid "
MFA
_code"
msgstr ""
#: users/forms.py:39 users/models/user.py:43
...
...
@@ -2290,7 +2291,7 @@ msgstr "复制你的公钥到这里"
#: users/forms.py:181 users/models/user.py:51
#: 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_pubkey_update.html:43
msgid "Public key"
...
...
@@ -2328,18 +2329,18 @@ msgstr "管理员"
msgid "Application"
msgstr "应用程序"
#: users/models/user.py:34 users/templates/users/user_profile.html:
74
#: users/templates/users/user_profile.html:15
5
#: users/templates/users/user_profile.html:15
8
#: users/models/user.py:34 users/templates/users/user_profile.html:
92
#: users/templates/users/user_profile.html:15
6
#: users/templates/users/user_profile.html:15
9
msgid "Disable"
msgstr "禁用"
#: users/models/user.py:35 users/templates/users/user_profile.html:
72
#: users/templates/users/user_profile.html:16
2
#: users/models/user.py:35 users/templates/users/user_profile.html:
90
#: users/templates/users/user_profile.html:16
3
msgid "Enable"
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"
msgstr "强制启用"
...
...
@@ -2356,7 +2357,7 @@ msgstr "头像"
msgid "Wechat"
msgstr "微信"
#: users/models/user.py:47
users/templates/users/user_detail.html:91
#: users/models/user.py:47
msgid "Enable OTP"
msgstr "二次验证"
...
...
@@ -2457,8 +2458,10 @@ msgid "City"
msgstr "城市"
#: users/templates/users/login_otp.html:45
msgid "二次认证"
msgstr ""
#: users/templates/users/user_detail.html:91
#: users/templates/users/user_profile.html:85
msgid "MFA certification"
msgstr "MFA认证"
#: users/templates/users/login_otp.html:64
#: users/templates/users/user_otp_authentication.html:19
...
...
@@ -2468,7 +2471,7 @@ msgstr "6位数字"
#: users/templates/users/login_otp.html:69
msgid "Can't provide security? Please contact the administrator!"
msgstr "如果不能提供
OTP
验证码,请联系管理员!"
msgstr "如果不能提供
MFA
验证码,请联系管理员!"
#: users/templates/users/reset_password.html:45
#: users/templates/users/user_detail.html:348 users/utils.py:73
...
...
@@ -2514,13 +2517,13 @@ msgid "Disabled"
msgstr "禁用"
#: users/templates/users/user_detail.html:115
#: users/templates/users/user_profile.html:10
0
#: users/templates/users/user_profile.html:10
1
msgid "Last login"
msgstr "最后登录"
#: users/templates/users/user_detail.html:151
msgid "Force enabled
OTP
"
msgstr "强制启用
OTP
"
msgid "Force enabled
MFA
"
msgstr "强制启用
MFA
"
#: users/templates/users/user_detail.html:166
msgid "Send reset password mail"
...
...
@@ -2536,8 +2539,8 @@ msgid "Send reset ssh key mail"
msgstr "发送重置密钥邮件"
#: users/templates/users/user_detail.html:291
msgid "Goto profile page enable
otp
"
msgstr "请去个人信息页面启用自己的
OTP
"
msgid "Goto profile page enable
MFA
"
msgstr "请去个人信息页面启用自己的
MFA
"
#: users/templates/users/user_detail.html:347
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 "将会失效用户当前密钥,并发送重置邮件到用户邮箱"
#: users/templates/users/user_detail.html:400
#: users/templates/users/user_profile.html:20
3
#: users/templates/users/user_profile.html:20
4
msgid "Successfully updated the SSH public key."
msgstr "更新ssh密钥成功"
#: users/templates/users/user_detail.html:401
#: users/templates/users/user_detail.html:405
#: users/templates/users/user_profile.html:20
4
#: users/templates/users/user_profile.html:2
09
#: users/templates/users/user_profile.html:20
5
#: users/templates/users/user_profile.html:2
10
msgid "User SSH public key update"
msgstr "ssh密钥"
...
...
@@ -2625,32 +2628,28 @@ msgstr "删除"
msgid "User Deleting failed."
msgstr "用户删除失败"
#: users/templates/users/user_profile.html:67
msgid "OTP"
msgstr ""
#: users/templates/users/user_profile.html:108 users/views/user.py:185
#: users/templates/users/user_profile.html:109 users/views/user.py:185
#: users/views/user.py:239
msgid "User groups"
msgstr "用户组"
#: users/templates/users/user_profile.html:14
0
#: users/templates/users/user_profile.html:14
1
msgid "Update password"
msgstr "更改密码"
#: users/templates/users/user_profile.html:14
8
msgid "Update
otp
"
msgstr "更改
OTP
设置"
#: users/templates/users/user_profile.html:14
9
msgid "Update
MFA settings
"
msgstr "更改
MFA
设置"
#: users/templates/users/user_profile.html:1
69
#: users/templates/users/user_profile.html:1
70
msgid "Update SSH public key"
msgstr "更改SSH密钥"
#: users/templates/users/user_profile.html:17
7
#: users/templates/users/user_profile.html:17
8
msgid "Reset public key and download"
msgstr "重置并下载SSH密钥"
#: users/templates/users/user_profile.html:20
7
#: users/templates/users/user_profile.html:20
8
msgid "Failed to update SSH public key."
msgstr "更新密钥失败"
...
...
@@ -2821,8 +2820,8 @@ msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:107 users/views/user.py:464 users/views/user.py:489
msgid "
Otp
code invalid"
msgstr "
otp
码认证失败"
msgid "
MFA
code invalid"
msgstr "
MFA
码认证失败"
#: users/views/login.py:133
msgid "Logout success"
...
...
@@ -2898,20 +2897,20 @@ msgid "Password invalid"
msgstr "用户名或密码无效"
#: users/views/user.py:515
msgid "
OTP
enable success"
msgstr "
OTP
绑定成功"
msgid "
MFA
enable success"
msgstr "
MFA
绑定成功"
#: users/views/user.py:516
msgid "
OTP
enable success, return login page"
msgstr "
OTP
绑定成功,返回到登录页面"
msgid "
MFA
enable success, return login page"
msgstr "
MFA
绑定成功,返回到登录页面"
#: users/views/user.py:518
msgid "
OTP
disable success"
msgstr "
OTP
解绑成功"
msgid "
MFA
disable success"
msgstr "
MFA
解绑成功"
#: users/views/user.py:519
msgid "
OTP
disable success, return login page"
msgstr "
OTP
解绑成功,返回登录页面"
msgid "
MFA
disable success, return login page"
msgstr "
MFA
解绑成功,返回登录页面"
#~ msgid "Add asset"
#~ msgstr "添加资产到节点"
apps/users/forms.py
View file @
7a219e17
...
...
@@ -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
):
...
...
apps/users/templates/users/_base_otp.html
View file @
7a219e17
...
...
@@ -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>
...
...
apps/users/templates/users/login_otp.html
View file @
7a219e17
...
...
@@ -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"
>
...
...
apps/users/templates/users/user_detail.html
View file @
7a219e17
...
...
@@ -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
%
}
...
...
apps/users/templates/users/user_profile.html
View file @
7a219e17
...
...
@@ -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=
""
...
...
apps/users/views/login.py
View file @
7a219e17
...
...
@@ -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
):
...
...
apps/users/views/user.py
View file @
7a219e17
...
...
@@ -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
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