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
e865484a
Unverified
Commit
e865484a
authored
Apr 20, 2018
by
老广
Committed by
GitHub
Apr 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1224 from jumpserver/dev
Dev
parents
a0a8419c
ad6e22cd
Show 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 @
e865484a
...
@@ -31,7 +31,7 @@
...
@@ -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>
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
e865484a
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
e865484a
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -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 "创建日期"
...
@@ -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:12
2
#: users/templates/users/user_profile.html:12
3
msgid "Comment"
msgid "Comment"
msgstr "备注"
msgstr "备注"
...
@@ -561,8 +561,9 @@ msgid "Select System Users"
...
@@ -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 "其它"
...
@@ -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:18
0
#: users/templates/users/user_profile.html:18
1
#: 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 "测试"
...
@@ -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:14
3
#: users/templates/users/user_profile.html:14
4
#: users/templates/users/user_profile.html:17
2
#: users/templates/users/user_profile.html:17
3
msgid "Update"
msgid "Update"
msgstr "更新"
msgstr "更新"
...
@@ -794,7 +795,7 @@ 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:21
4
#: users/templates/users/user_profile.html:21
5
msgid "Confirm"
msgid "Confirm"
msgstr "确认"
msgstr "确认"
...
@@ -845,14 +846,14 @@ 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:9
6
#: users/templates/users/user_profile.html:9
7
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:13
4
#: users/templates/users/user_profile.html:13
5
msgid "Quick modify"
msgid "Quick modify"
msgstr "快速修改"
msgstr "快速修改"
...
@@ -1730,7 +1731,7 @@ 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:10
4
#: users/templates/users/user_profile.html:10
5
msgid "Date expired"
msgid "Date expired"
msgstr "失效日期"
msgstr "失效日期"
...
@@ -2229,7 +2230,7 @@ msgid "Invalid token or cache refreshed."
...
@@ -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 "复制你的公钥到这里"
...
@@ -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 "管理员"
...
@@ -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:15
5
#: users/templates/users/user_profile.html:15
6
#: users/templates/users/user_profile.html:15
8
#: users/templates/users/user_profile.html:15
9
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:16
2
#: users/templates/users/user_profile.html:16
3
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 "头像"
...
@@ -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"
...
@@ -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位数字"
...
@@ -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"
...
@@ -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:10
0
#: users/templates/users/user_profile.html:10
1
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"
...
@@ -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"
...
@@ -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:20
3
#: users/templates/users/user_profile.html:20
4
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:20
4
#: users/templates/users/user_profile.html:20
5
#: users/templates/users/user_profile.html:2
09
#: users/templates/users/user_profile.html:2
10
msgid "User SSH public key update"
msgid "User SSH public key update"
msgstr "ssh密钥"
msgstr "ssh密钥"
...
@@ -2625,32 +2628,28 @@ msgstr "删除"
...
@@ -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:14
0
#: users/templates/users/user_profile.html:14
1
msgid "Update password"
msgid "Update password"
msgstr "更改密码"
msgstr "更改密码"
#: users/templates/users/user_profile.html:14
8
#: users/templates/users/user_profile.html:14
9
msgid "Update
otp
"
msgid "Update
MFA settings
"
msgstr "更改
OTP
设置"
msgstr "更改
MFA
设置"
#: users/templates/users/user_profile.html:1
69
#: users/templates/users/user_profile.html:1
70
msgid "Update SSH public key"
msgid "Update SSH public key"
msgstr "更改SSH密钥"
msgstr "更改SSH密钥"
#: users/templates/users/user_profile.html:17
7
#: users/templates/users/user_profile.html:17
8
msgid "Reset public key and download"
msgid "Reset public key and download"
msgstr "重置并下载SSH密钥"
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."
msgid "Failed to update SSH public key."
msgstr "更新密钥失败"
msgstr "更新密钥失败"
...
@@ -2821,8 +2820,8 @@ msgid "Please enable cookies and try again."
...
@@ -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"
...
@@ -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 "添加资产到节点"
apps/users/forms.py
View file @
e865484a
...
@@ -27,7 +27,7 @@ class UserCheckPasswordForm(forms.Form):
...
@@ -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
):
...
...
apps/users/templates/users/_base_otp.html
View file @
e865484a
...
@@ -54,7 +54,7 @@
...
@@ -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>
...
...
apps/users/templates/users/login_otp.html
View file @
e865484a
...
@@ -42,7 +42,7 @@
...
@@ -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"
>
...
...
apps/users/templates/users/user_detail.html
View file @
e865484a
...
@@ -88,7 +88,7 @@
...
@@ -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 @@
...
@@ -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() {
...
@@ -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
%
}
...
...
apps/users/templates/users/user_profile.html
View file @
e865484a
...
@@ -63,18 +63,7 @@
...
@@ -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 @@
...
@@ -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 @@
...
@@ -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=
""
...
...
apps/users/views/login.py
View file @
e865484a
...
@@ -104,7 +104,7 @@ class UserLoginOtpView(FormView):
...
@@ -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
):
...
...
apps/users/views/user.py
View file @
e865484a
...
@@ -461,7 +461,7 @@ class UserOtpEnableBindView(TemplateView, FormView):
...
@@ -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):
...
@@ -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):
...
@@ -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
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