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
545d4fa6
Unverified
Commit
545d4fa6
authored
Dec 27, 2018
by
老广
Committed by
GitHub
Dec 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2287 from jumpserver/dev
[Update] 禁用其他认证方式修改密码 (#2286)
parents
e3db7462
560df502
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
151 additions
and
111 deletions
+151
-111
django.po
apps/locale/zh/LC_MESSAGES/django.po
+101
-99
command_execution_create.html
apps/ops/templates/ops/command_execution_create.html
+0
-1
user.py
apps/users/models/user.py
+7
-0
user_detail.html
apps/users/templates/users/user_detail.html
+2
-0
user_profile.html
apps/users/templates/users/user_profile.html
+10
-8
user_update.html
apps/users/templates/users/user_update.html
+21
-2
login.py
apps/users/views/login.py
+4
-1
user.py
apps/users/views/user.py
+6
-0
No files found.
apps/locale/zh/LC_MESSAGES/django.po
View file @
545d4fa6
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-2
6 13:42
+0800\n"
"POT-Creation-Date: 2018-12-2
7 15:48
+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"
...
...
@@ -119,7 +119,7 @@ msgstr "端口"
#: perms/templates/perms/asset_permission_create_update.html:45
#: perms/templates/perms/asset_permission_list.html:56
#: perms/templates/perms/asset_permission_list.html:114
#: terminal/backends/command/models.py:13 terminal/models.py:14
0
#: terminal/backends/command/models.py:13 terminal/models.py:14
1
#: terminal/templates/terminal/command_list.html:40
#: terminal/templates/terminal/command_list.html:73
#: terminal/templates/terminal/session_list.html:41
...
...
@@ -157,7 +157,7 @@ msgstr "不能包含特殊字符"
#: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_list.html:53
#: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:20
#: terminal/models.py:19
7
terminal/templates/terminal/terminal_detail.html:43
#: terminal/models.py:19
8
terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:53 users/templates/users/_select_user_modal.html:13
#: users/templates/users/user_detail.html:63
...
...
@@ -206,6 +206,7 @@ msgstr "密码或密钥密码"
#: users/templates/users/user_password_update.html:43
#: users/templates/users/user_profile_update.html:40
#: users/templates/users/user_pubkey_update.html:40
#: users/templates/users/user_update.html:20
msgid "Password"
msgstr "密码"
...
...
@@ -500,7 +501,7 @@ msgid "Default"
msgstr "默认"
#: assets/models/cluster.py:36 assets/models/label.py:14
#: users/models/user.py:43
2
#: users/models/user.py:43
9
msgid "System"
msgstr "系统"
...
...
@@ -529,7 +530,7 @@ msgid "Regex"
msgstr "正则表达式"
#: assets/models/cmd_filter.py:36 ops/models/command.py:19
#: ops/templates/ops/command_execution_list.html:60 terminal/models.py:14
6
#: ops/templates/ops/command_execution_list.html:60 terminal/models.py:14
7
#: terminal/templates/terminal/command_list.html:55
#: terminal/templates/terminal/command_list.html:71
#: terminal/templates/terminal/session_detail.html:48
...
...
@@ -633,12 +634,12 @@ msgstr "默认资产组"
#: perms/templates/perms/asset_permission_create_update.html:41
#: perms/templates/perms/asset_permission_list.html:54
#: perms/templates/perms/asset_permission_list.html:108 templates/index.html:87
#: terminal/backends/command/models.py:12 terminal/models.py:1
39
#: terminal/backends/command/models.py:12 terminal/models.py:1
40
#: terminal/templates/terminal/command_list.html:32
#: terminal/templates/terminal/command_list.html:72
#: terminal/templates/terminal/session_list.html:33
#: terminal/templates/terminal/session_list.html:71 users/forms.py:303
#: users/models/user.py:33 users/models/user.py:42
0
#: users/models/user.py:33 users/models/user.py:42
7
#: users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:13 users/views/user.py:386
#: xpack/plugins/orgs/forms.py:26
...
...
@@ -720,7 +721,7 @@ msgstr "登录模式"
#: perms/templates/perms/asset_permission_detail.html:140
#: perms/templates/perms/asset_permission_list.html:58
#: perms/templates/perms/asset_permission_list.html:120 templates/_nav.html:25
#: terminal/backends/command/models.py:14 terminal/models.py:14
1
#: terminal/backends/command/models.py:14 terminal/models.py:14
2
#: terminal/templates/terminal/command_list.html:48
#: terminal/templates/terminal/command_list.html:74
#: terminal/templates/terminal/session_list.html:49
...
...
@@ -906,7 +907,7 @@ msgstr "其它"
#: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_detail.html:176
#: users/templates/users/user_password_update.html:71
#: users/templates/users/user_profile.html:20
2
#: users/templates/users/user_profile.html:20
4
#: users/templates/users/user_profile_update.html:63
#: users/templates/users/user_pubkey_update.html:70
#: users/templates/users/user_pubkey_update.html:76
...
...
@@ -1027,9 +1028,9 @@ msgstr "测试"
#: users/templates/users/user_group_detail.html:28
#: users/templates/users/user_group_list.html:43
#: users/templates/users/user_list.html:80
#: users/templates/users/user_profile.html:1
55
#: users/templates/users/user_profile.html:18
5
#: users/templates/users/user_profile.html:19
4
#: users/templates/users/user_profile.html:1
77
#: users/templates/users/user_profile.html:18
7
#: users/templates/users/user_profile.html:19
6
#: xpack/plugins/cloud/templates/cloud/account_detail.html:25
#: xpack/plugins/cloud/templates/cloud/account_list.html:38
#: xpack/plugins/orgs/templates/orgs/org_detail.html:25
...
...
@@ -1089,14 +1090,14 @@ msgstr "选择节点"
#: assets/templates/assets/system_user_list.html:143
#: common/templates/common/terminal_setting.html:165 templates/_modal.html:22
#: terminal/templates/terminal/session_detail.html:108
#: users/templates/users/user_detail.html:38
6
#: users/templates/users/user_detail.html:41
2
#: users/templates/users/user_detail.html:43
5
#: users/templates/users/user_detail.html:48
0
#: users/templates/users/user_detail.html:38
8
#: users/templates/users/user_detail.html:41
4
#: users/templates/users/user_detail.html:43
7
#: users/templates/users/user_detail.html:48
2
#: users/templates/users/user_group_create_update.html:32
#: users/templates/users/user_group_list.html:88
#: users/templates/users/user_list.html:208
#: users/templates/users/user_profile.html:23
6
#: users/templates/users/user_profile.html:23
8
#: xpack/plugins/cloud/templates/cloud/account_create_update.html:34
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_create.html:36
#: xpack/plugins/orgs/templates/orgs/org_create_update.html:33
...
...
@@ -1187,8 +1188,8 @@ msgid "Refresh"
msgstr "刷新"
#: assets/templates/assets/asset_detail.html:308
#: users/templates/users/user_detail.html:30
5
#: users/templates/users/user_detail.html:33
2
#: users/templates/users/user_detail.html:30
7
#: users/templates/users/user_detail.html:33
4
msgid "Update successfully!"
msgstr "更新成功"
...
...
@@ -1305,9 +1306,9 @@ msgstr "重命名失败,不能更改root节点的名称"
#: assets/templates/assets/asset_list.html:629
#: assets/templates/assets/system_user_list.html:137
#: users/templates/users/user_detail.html:38
0
#: users/templates/users/user_detail.html:40
6
#: users/templates/users/user_detail.html:47
4
#: users/templates/users/user_detail.html:38
2
#: users/templates/users/user_detail.html:40
8
#: users/templates/users/user_detail.html:47
6
#: users/templates/users/user_group_list.html:82
#: users/templates/users/user_list.html:202
msgid "Are you sure?"
...
...
@@ -1320,9 +1321,9 @@ msgstr "删除选择资产"
#: assets/templates/assets/asset_list.html:633
#: assets/templates/assets/system_user_list.html:141
#: common/templates/common/terminal_setting.html:163
#: users/templates/users/user_detail.html:38
4
#: users/templates/users/user_detail.html:41
0
#: users/templates/users/user_detail.html:4
78
#: users/templates/users/user_detail.html:38
6
#: users/templates/users/user_detail.html:41
2
#: users/templates/users/user_detail.html:4
80
#: users/templates/users/user_group_create_update.html:31
#: users/templates/users/user_group_list.html:86
#: users/templates/users/user_list.html:206
...
...
@@ -1656,7 +1657,7 @@ msgstr "系统用户资产"
#: audits/templates/audits/ftp_log_list.html:73
#: audits/templates/audits/operate_log_list.html:70
#: audits/templates/audits/password_change_log_list.html:52
#: terminal/models.py:14
3
terminal/templates/terminal/session_list.html:74
#: terminal/models.py:14
4
terminal/templates/terminal/session_list.html:74
#: terminal/templates/terminal/terminal_detail.html:47
msgid "Remote addr"
msgstr "远端地址"
...
...
@@ -1673,7 +1674,7 @@ msgstr "文件名"
#: audits/models.py:22 audits/templates/audits/ftp_log_list.html:76
#: ops/templates/ops/command_execution_list.html:64
#: ops/templates/ops/task_list.html:39 users/models/authentication.py:73
#: users/templates/users/user_detail.html:45
6
xpack/plugins/cloud/api.py:61
#: users/templates/users/user_detail.html:45
8
xpack/plugins/cloud/api.py:61
msgid "Success"
msgstr "成功"
...
...
@@ -1699,7 +1700,7 @@ msgstr "修改者"
#: ops/templates/ops/adhoc_history_detail.html:61
#: ops/templates/ops/command_execution_list.html:65
#: ops/templates/ops/task_history.html:58 perms/models.py:35
#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:15
0
#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:15
1
#: terminal/templates/terminal/session_list.html:78
msgid "Date start"
msgstr "开始日期"
...
...
@@ -2564,7 +2565,7 @@ msgstr "组织管理"
#: perms/templates/perms/asset_permission_list.html:111 templates/_nav.html:14
#: users/forms.py:273 users/models/group.py:26 users/models/user.py:59
#: users/templates/users/_select_user_modal.html:16
#: users/templates/users/user_detail.html:21
1
#: users/templates/users/user_detail.html:21
3
#: users/templates/users/user_list.html:26
#: xpack/plugins/orgs/templates/orgs/org_list.html:15
msgid "User group"
...
...
@@ -2610,7 +2611,7 @@ msgid "Add node to this permission"
msgstr "添加节点"
#: perms/templates/perms/asset_permission_asset.html:125
#: users/templates/users/user_detail.html:2
28
#: users/templates/users/user_detail.html:2
30
msgid "Join"
msgstr "加入"
...
...
@@ -2798,9 +2799,9 @@ msgstr ""
#: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44
#: users/views/group.py:60 users/views/group.py:76 users/views/group.py:92
#: users/views/login.py:34
6
users/views/user.py:68 users/views/user.py:83
#: users/views/login.py:34
9
users/views/user.py:68 users/views/user.py:83
#: users/views/user.py:113 users/views/user.py:194 users/views/user.py:355
#: users/views/user.py:405 users/views/user.py:4
39
#: users/views/user.py:405 users/views/user.py:4
44
msgid "Users"
msgstr "用户管理"
...
...
@@ -3089,19 +3090,19 @@ msgstr "线程数"
msgid "Boot Time"
msgstr "运行时间"
#: terminal/models.py:14
5
terminal/templates/terminal/session_list.html:104
#: terminal/models.py:14
6
terminal/templates/terminal/session_list.html:104
msgid "Replay"
msgstr "回放"
#: terminal/models.py:1
49
#: terminal/models.py:1
50
msgid "Date last active"
msgstr "最后活跃日期"
#: terminal/models.py:15
1
#: terminal/models.py:15
2
msgid "Date end"
msgstr "结束日期"
#: terminal/models.py:19
8
#: terminal/models.py:19
9
msgid "Args"
msgstr "参数"
...
...
@@ -3337,7 +3338,7 @@ msgstr ""
msgid "Paste user id_rsa.pub here."
msgstr "复制用户公钥到这里"
#: users/forms.py:71 users/templates/users/user_detail.html:2
19
#: users/forms.py:71 users/templates/users/user_detail.html:2
21
msgid "Join user groups"
msgstr "添加到用户组"
...
...
@@ -3472,7 +3473,7 @@ msgstr "Agent"
msgid "Date login"
msgstr "登录日期"
#: users/models/user.py:32 users/models/user.py:4
28
#: users/models/user.py:32 users/models/user.py:4
35
msgid "Administrator"
msgstr "管理员"
...
...
@@ -3481,13 +3482,13 @@ msgid "Application"
msgstr "应用程序"
#: users/models/user.py:37 users/templates/users/user_profile.html:92
#: users/templates/users/user_profile.html:1
67
#: users/templates/users/user_profile.html:1
70
#: users/templates/users/user_profile.html:1
59
#: users/templates/users/user_profile.html:1
62
msgid "Disable"
msgstr "禁用"
#: users/models/user.py:38 users/templates/users/user_profile.html:90
#: users/templates/users/user_profile.html:1
74
#: users/templates/users/user_profile.html:1
66
msgid "Enable"
msgstr "启用"
...
...
@@ -3518,7 +3519,12 @@ msgstr "用户来源"
msgid "Date password last updated"
msgstr "最后更新密码日期"
#: users/models/user.py:431
#: users/models/user.py:126 users/templates/users/user_update.html:22
#: users/views/login.py:243 users/views/login.py:302 users/views/user.py:418
msgid "User auth from {}, go there change password"
msgstr "用户认证源来自 {}, 请去相应系统修改密码"
#: users/models/user.py:438
msgid "Administrator is the super user of system"
msgstr "Administrator是初始的超级管理员"
...
...
@@ -3735,19 +3741,19 @@ msgid "Always young, always with tears in my eyes. Stay foolish Stay hungry"
msgstr "永远年轻,永远热泪盈眶 stay foolish stay hungry"
#: users/templates/users/reset_password.html:46
#: users/templates/users/user_detail.html:37
1
users/utils.py:81
#: users/templates/users/user_detail.html:37
3
users/utils.py:81
msgid "Reset password"
msgstr "重置密码"
#: users/templates/users/reset_password.html:59
#: users/templates/users/user_password_update.html:61
#: users/templates/users/user_update.html:1
2
#: users/templates/users/user_update.html:1
3
msgid "Your password must satisfy"
msgstr "您的密码必须满足:"
#: users/templates/users/reset_password.html:60
#: users/templates/users/user_password_update.html:62
#: users/templates/users/user_update.html:1
3
#: users/templates/users/user_update.html:1
4
msgid "Password strength"
msgstr "密码强度:"
...
...
@@ -3762,37 +3768,37 @@ msgstr "设置"
#: users/templates/users/reset_password.html:105
#: users/templates/users/user_password_update.html:99
#: users/templates/users/user_update.html:
34
#: users/templates/users/user_update.html:
46
msgid "Very weak"
msgstr "很弱"
#: users/templates/users/reset_password.html:106
#: users/templates/users/user_password_update.html:100
#: users/templates/users/user_update.html:
35
#: users/templates/users/user_update.html:
47
msgid "Weak"
msgstr "弱"
#: users/templates/users/reset_password.html:107
#: users/templates/users/user_password_update.html:101
#: users/templates/users/user_update.html:
36
#: users/templates/users/user_update.html:
48
msgid "Normal"
msgstr "正常"
#: users/templates/users/reset_password.html:108
#: users/templates/users/user_password_update.html:102
#: users/templates/users/user_update.html:
37
#: users/templates/users/user_update.html:
49
msgid "Medium"
msgstr "一般"
#: users/templates/users/reset_password.html:109
#: users/templates/users/user_password_update.html:103
#: users/templates/users/user_update.html:
38
#: users/templates/users/user_update.html:
50
msgid "Strong"
msgstr "强"
#: users/templates/users/reset_password.html:110
#: users/templates/users/user_password_update.html:104
#: users/templates/users/user_update.html:
39
#: users/templates/users/user_update.html:
51
msgid "Very strong"
msgstr "很强"
...
...
@@ -3839,71 +3845,71 @@ msgstr "强制启用MFA"
msgid "Reset MFA"
msgstr "重置MFA"
#: users/templates/users/user_detail.html:18
1
#: users/templates/users/user_detail.html:18
2
msgid "Send reset password mail"
msgstr "发送重置密码邮件"
#: users/templates/users/user_detail.html:18
4
#: users/templates/users/user_detail.html:19
2
#: users/templates/users/user_detail.html:18
5
#: users/templates/users/user_detail.html:19
4
msgid "Send"
msgstr "发送"
#: users/templates/users/user_detail.html:1
89
#: users/templates/users/user_detail.html:1
91
msgid "Send reset ssh key mail"
msgstr "发送重置密钥邮件"
#: users/templates/users/user_detail.html:19
7
#: users/templates/users/user_detail.html:4
59
#: users/templates/users/user_detail.html:19
9
#: users/templates/users/user_detail.html:4
61
msgid "Unblock user"
msgstr "解除登录限制"
#: users/templates/users/user_detail.html:20
0
#: users/templates/users/user_detail.html:20
2
msgid "Unblock"
msgstr "解除"
#: users/templates/users/user_detail.html:31
4
#: users/templates/users/user_detail.html:31
6
msgid "Goto profile page enable MFA"
msgstr "请去个人信息页面启用自己的MFA"
#: users/templates/users/user_detail.html:37
0
#: users/templates/users/user_detail.html:37
2
msgid "An e-mail has been sent to the user`s mailbox."
msgstr "已发送邮件到用户邮箱"
#: users/templates/users/user_detail.html:38
1
#: users/templates/users/user_detail.html:38
3
msgid "This will reset the user password and send a reset mail"
msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱"
#: users/templates/users/user_detail.html:39
6
#: users/templates/users/user_detail.html:39
8
msgid ""
"The reset-ssh-public-key E-mail has been sent successfully. Please inform "
"the user to update his new ssh public key."
msgstr "重设密钥邮件将会发送到用户邮箱"
#: users/templates/users/user_detail.html:39
7
#: users/templates/users/user_detail.html:39
9
msgid "Reset SSH public key"
msgstr "重置SSH密钥"
#: users/templates/users/user_detail.html:40
7
#: users/templates/users/user_detail.html:40
9
msgid "This will reset the user public key and send a reset mail"
msgstr "将会失效用户当前密钥,并发送重置邮件到用户邮箱"
#: users/templates/users/user_detail.html:42
5
#: users/templates/users/user_profile.html:22
5
#: users/templates/users/user_detail.html:42
7
#: users/templates/users/user_profile.html:22
7
msgid "Successfully updated the SSH public key."
msgstr "更新ssh密钥成功"
#: users/templates/users/user_detail.html:42
6
#: users/templates/users/user_detail.html:43
0
#: users/templates/users/user_profile.html:22
6
#: users/templates/users/user_profile.html:23
1
#: users/templates/users/user_detail.html:42
8
#: users/templates/users/user_detail.html:43
2
#: users/templates/users/user_profile.html:22
8
#: users/templates/users/user_profile.html:23
3
msgid "User SSH public key update"
msgstr "ssh密钥"
#: users/templates/users/user_detail.html:47
5
#: users/templates/users/user_detail.html:47
7
msgid "After unlocking the user, the user can log in normally."
msgstr "解除用户登录限制后,此用户即可正常登录"
#: users/templates/users/user_detail.html:4
89
#: users/templates/users/user_detail.html:4
91
msgid "Reset user MFA success"
msgstr "重置用户MFA成功"
...
...
@@ -4021,26 +4027,26 @@ msgid "User groups"
msgstr "用户组"
#: users/templates/users/user_profile.html:152
msgid "Update password"
msgstr "更改密码"
#: users/templates/users/user_profile.html:160
msgid "Set MFA"
msgstr "设置MFA"
#: users/templates/users/user_profile.html:182
#: users/templates/users/user_profile.html:174
msgid "Update password"
msgstr "更改密码"
#: users/templates/users/user_profile.html:184
msgid "Update MFA"
msgstr "更改MFA"
#: users/templates/users/user_profile.html:19
1
#: users/templates/users/user_profile.html:19
3
msgid "Update SSH public key"
msgstr "更改SSH密钥"
#: users/templates/users/user_profile.html:
199
#: users/templates/users/user_profile.html:
201
msgid "Reset public key and download"
msgstr "重置并下载SSH密钥"
#: users/templates/users/user_profile.html:2
29
#: users/templates/users/user_profile.html:2
31
msgid "Failed to update SSH public key."
msgstr "更新密钥失败"
...
...
@@ -4273,7 +4279,7 @@ msgstr "用户组授权资产"
msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:191 users/views/user.py:5
26 users/views/user.py:551
#: users/views/login.py:191 users/views/user.py:5
31 users/views/user.py:556
msgid "MFA code invalid, or ntp sync server time"
msgstr "MFA验证码不正确,或者服务器端时间不对"
...
...
@@ -4289,10 +4295,6 @@ msgstr "退出登录成功,返回到登录页面"
msgid "Email address invalid, please input again"
msgstr "邮箱地址错误,重新输入"
#: users/views/login.py:243
msgid "User auth from {}, go there change password"
msgstr "用户认证源来自 {}, 请去相应系统修改密码"
#: users/views/login.py:256
msgid "Send reset password message"
msgstr "发送重置密码邮件"
...
...
@@ -4310,7 +4312,7 @@ msgstr "重置密码成功"
msgid "Reset password success, return to login page"
msgstr "重置密码成功,返回到登录页面"
#: users/views/login.py:286 users/views/login.py:30
2
#: users/views/login.py:286 users/views/login.py:30
5
msgid "Token invalid or expired"
msgstr "Token错误或失效"
...
...
@@ -4318,11 +4320,11 @@ msgstr "Token错误或失效"
msgid "Password not same"
msgstr "密码不一致"
#: users/views/login.py:3
08 users/views/user.py:128 users/views/user.py:422
#: users/views/login.py:3
11 users/views/user.py:128 users/views/user.py:427
msgid "* Your password does not meet the requirements"
msgstr "* 您的密码不符合要求"
#: users/views/login.py:34
6
#: users/views/login.py:34
9
msgid "First login"
msgstr "首次登陆"
...
...
@@ -4350,27 +4352,27 @@ msgstr "个人信息设置"
msgid "Password update"
msgstr "密码更新"
#: users/views/user.py:44
0
#: users/views/user.py:44
5
msgid "Public key update"
msgstr "密钥更新"
#: users/views/user.py:48
1
#: users/views/user.py:48
6
msgid "Password invalid"
msgstr "用户名或密码无效"
#: users/views/user.py:58
1
#: users/views/user.py:58
6
msgid "MFA enable success"
msgstr "MFA 绑定成功"
#: users/views/user.py:58
2
#: users/views/user.py:58
7
msgid "MFA enable success, return login page"
msgstr "MFA 绑定成功,返回到登录页面"
#: users/views/user.py:58
4
#: users/views/user.py:58
9
msgid "MFA disable success"
msgstr "MFA 解绑成功"
#: users/views/user.py:5
85
#: users/views/user.py:5
90
msgid "MFA disable success, return login page"
msgstr "MFA 解绑成功,返回登录页面"
...
...
@@ -4386,23 +4388,23 @@ msgstr ""
msgid "Access Key Secret"
msgstr ""
#: xpack/plugins/cloud/forms.py:5
8
#: xpack/plugins/cloud/forms.py:5
2
msgid "Select account"
msgstr "选择账户"
#: xpack/plugins/cloud/forms.py:
64
#: xpack/plugins/cloud/forms.py:
58
msgid "Select regions"
msgstr "选择地域"
#: xpack/plugins/cloud/forms.py:
70
#: xpack/plugins/cloud/forms.py:
64
msgid "Select instances"
msgstr "选择实例"
#: xpack/plugins/cloud/forms.py:7
6
#: xpack/plugins/cloud/forms.py:7
0
msgid "Select node"
msgstr "选择节点"
#: xpack/plugins/cloud/forms.py:
82
xpack/plugins/orgs/forms.py:18
#: xpack/plugins/cloud/forms.py:
76
xpack/plugins/orgs/forms.py:18
msgid "Select admins"
msgstr "选择管理员"
...
...
apps/ops/templates/ops/command_execution_create.html
View file @
545d4fa6
...
...
@@ -265,7 +265,6 @@ $(document).ready(function(){
systemUserId
=
$
(
'#system-users-select'
).
val
();
$
(
".select2"
).
select2
({
dropdownAutoWidth
:
true
,
width
:
'auto'
}).
on
(
'select2:select'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
systemUserId
=
data
.
id
;
...
...
apps/users/models/user.py
View file @
545d4fa6
...
...
@@ -120,7 +120,14 @@ class User(AbstractUser):
def
set_password
(
self
,
raw_password
):
self
.
_set_password
=
True
if
self
.
can_update_password
():
return
super
()
.
set_password
(
raw_password
)
else
:
error
=
_
(
"User auth from {}, go there change password"
)
.
format
(
self
.
source
)
raise
PermissionError
(
error
)
def
can_update_password
(
self
):
return
self
.
is_local
@property
def
otp_secret_key
(
self
):
...
...
apps/users/templates/users/user_detail.html
View file @
545d4fa6
...
...
@@ -177,6 +177,7 @@
</span>
</td>
</tr>
{% if user_object.can_update_password %}
<tr>
<td>
{% trans 'Send reset password mail' %}:
</td>
<td>
...
...
@@ -185,6 +186,7 @@
</span>
</td>
</tr>
{% endif %}
<tr>
<td>
{% trans 'Send reset ssh key mail' %}:
</td>
<td>
...
...
apps/users/templates/users/user_profile.html
View file @
545d4fa6
...
...
@@ -148,14 +148,6 @@
<div
class=
"panel-body"
>
<table
class=
"table"
>
<tbody>
<tr
class=
"no-borders-tr"
>
<td>
{% trans 'Update password' %}:
</td>
<td>
<span
class=
"pull-right"
>
<a
type=
"button"
class=
"btn btn-primary btn-xs"
style=
"width: 54px"
href=
"{% url 'users:user-password-update' %}"
>
{% trans 'Update' %}
</a>
</span>
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td>
{% trans 'Set MFA' %}:
</td>
<td>
...
...
@@ -177,6 +169,16 @@
</span>
</td>
</tr>
{% if request.user.can_update_password %}
<tr
class=
"no-borders"
>
<td>
{% trans 'Update password' %}:
</td>
<td>
<span
class=
"pull-right"
>
<a
type=
"button"
class=
"btn btn-primary btn-xs"
style=
"width: 54px"
href=
"{% url 'users:user-password-update' %}"
>
{% trans 'Update' %}
</a>
</span>
</td>
</tr>
{% endif %}
{% if request.user.otp_enabled and request.user.otp_secret_key %}
<tr>
<td>
{% trans 'Update MFA' %}:
</td>
...
...
apps/users/templates/users/user_update.html
View file @
545d4fa6
...
...
@@ -3,6 +3,7 @@
{% load bootstrap3 %}
{% block user_template_title %}{% trans "Update user" %}{% endblock %}
{% block password %}
{% if object.can_update_password %}
{% bootstrap_field form.password layout="horizontal" %}
{# 密码popover #}
<div
id=
"container"
>
...
...
@@ -14,13 +15,24 @@
<div
class=
"popover-content"
></div>
</div>
</div>
{% else %}
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
{% trans 'Password' %}
</label>
<div
class=
"col-sm-8 controls"
style=
"margin-top: 8px;"
id=
"password_help_text"
>
{% trans 'User auth from {}, go there change password' %}
</div>
</div>
{% endif %}
{% bootstrap_field form.public_key layout="horizontal" %}
{% endblock %}
{% block custom_foot_js %}
{{ block.super }}
<script>
$
(
document
).
ready
(
function
(){
function
passwordCheck
()
{
if
(
$
(
'#id_password'
).
length
!=
1
)
{
return
}
var
el
=
$
(
'#id_password_rules'
),
idPassword
=
$
(
'#id_password'
),
idPopover
=
$
(
'#popover777'
),
...
...
@@ -39,7 +51,7 @@
"veryStrong"
:
"{% trans 'Very strong' %}"
};
jQuery
.
each
(
password_check_rules
,
function
(
idx
,
rules
)
{
$
.
each
(
password_check_rules
,
function
(
idx
,
rules
)
{
if
(
rules
.
key
===
'id_security_password_min_length'
){
minLength
=
rules
.
value
}
...
...
@@ -61,6 +73,13 @@
var
password
=
idPassword
.
val
();
checkPasswordRules
(
password
,
minLength
);
});
}
$
(
document
).
ready
(
function
(){
passwordCheck
();
var
origin_text
=
$
(
"#password_help_text"
).
text
();
var
new_text
=
origin_text
.
replace
(
'{}'
,
"{{ object.source_display }}"
);
$
(
"#password_help_text"
).
html
(
new_text
);
})
</script>
...
...
apps/users/views/login.py
View file @
545d4fa6
...
...
@@ -239,7 +239,7 @@ class UserForgotPasswordView(TemplateView):
if
not
user
:
error
=
_
(
'Email address invalid, please input again'
)
return
self
.
get
(
request
,
errors
=
error
)
elif
not
user
.
is_local
:
elif
not
user
.
can_update_password
()
:
error
=
_
(
'User auth from {}, go there change password'
.
format
(
user
.
source
))
return
self
.
get
(
request
,
errors
=
error
)
else
:
...
...
@@ -298,6 +298,9 @@ class UserResetPasswordView(TemplateView):
return
self
.
get
(
request
,
errors
=
_
(
'Password not same'
))
user
=
User
.
validate_reset_token
(
token
)
if
not
user
.
can_update_password
():
error
=
_
(
'User auth from {}, go there change password'
.
format
(
user
.
source
))
return
self
.
get
(
request
,
errors
=
error
)
if
not
user
:
return
self
.
get
(
request
,
errors
=
_
(
'Token invalid or expired'
))
...
...
apps/users/views/user.py
View file @
545d4fa6
...
...
@@ -414,6 +414,12 @@ class UserPasswordUpdateView(LoginRequiredMixin, UpdateView):
return
super
()
.
get_success_url
()
def
form_valid
(
self
,
form
):
if
not
self
.
request
.
user
.
can_update_password
():
error
=
_
(
"User auth from {}, go there change password"
)
.
format
(
self
.
request
.
source_display
)
form
.
add_error
(
"password"
,
error
)
return
self
.
form_invalid
(
form
)
password
=
form
.
cleaned_data
.
get
(
'new_password'
)
is_ok
=
check_password_rules
(
password
)
if
not
is_ok
:
...
...
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