From 64db02c3f8dfc7018e912d3933c77d1538e58290 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Wed, 6 Jun 2018 16:59:32 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=20db/ldap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/i18n/zh/LC_MESSAGES/django.mo | Bin 34391 -> 34427 bytes apps/i18n/zh/LC_MESSAGES/django.po | 338 ++++++++++--------- apps/users/models/user.py | 13 +- apps/users/serializers.py | 5 +- apps/users/signals_handler.py | 9 + apps/users/templates/users/user_detail.html | 4 + apps/users/templates/users/user_list.html | 7 +- apps/users/templates/users/user_profile.html | 4 + apps/users/views/login.py | 4 +- 9 files changed, 211 insertions(+), 173 deletions(-) diff --git a/apps/i18n/zh/LC_MESSAGES/django.mo b/apps/i18n/zh/LC_MESSAGES/django.mo index 78705cf79573f6cf34877f0304ae523bc3b6dafc..ace72c44b090277540ec8b072d5da101656d52b4 100644 GIT binary patch delta 10252 zcmXxq37pT>{>Sm}Z^ke)W-w-k(KP!$V;}nxV>c?2C0k>;)+mW2)mOR7TJ)tqp(v$M zSyCp#Rmip7h_2xxWGSh?r7TJA>pkDk{XHJv`#k4!&i9Br2NF0ZmI0bWXB|e1* zu{*YJ=r|AKLh}+T-nxz|;TZc`kmF_@gz6aG_ih4G_M?C`< zPy_yqn&5Yg!wOCP_GDChx>?(7Vzxm&Gxs-T|0z2?`5#U68fv09P-p!Xs^e`=Z7jjv9BOOF=hGL9KYY)!#s!(Oak^`50qx zD{9LRVcCwL2D*ScvdgF)iD>Rmn20*6Jk*Y~Ma}a7YJ9gJ1!Xo0^*T*N4KUN{OHdQ8 zvG^CL74JtSP>M?M6l#Jis2#eE8dqNiN-z>tuZ9{g4Y|*C>QK;tt<5f|8+xGs>q27`is3Tj78gPZRueJC#)P1{9<9&m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_{>e3f@+w^ImSz-G z`J9qI>$p~O_2o(@cFuh)GuBt$?Vs5uWDoTO_tVVSsI}IcPR@Vb1DVOsoFP)#qU(vi zLwOL_4vX>`NDQm$m$~HNSsK0Bjw#(k5X=fC%FFqIq9~~ijV$*$V{%iT+6uL zb)V1b;M?kM%S!G4Gj;tj3c^iX`h4Tze2k?QJBVSdsE_^z=(C;J3Txkwk8?F3{)Nhz z#MOgqgWEnk)3?rjKKp^B53T8{ldU{forbqUuk_tV_iyrV?Ra&6&?cLS3JVmhKOfKXGs7=K5mX z8np^TzNUSb+rL((Z?QYOR(z#n)N9bU2rtrC-{EoY`daxRp+tk+tF_wX{XyF{uIXF@ zxb!(}9>IlN*<9ne&d|2h9b7xpch!Bfc5FnNbQa5k)u\n" "Language-Team: Jumpserver team\n" @@ -17,19 +17,19 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: assets/api/node.py:106 +#: assets/api/node.py:99 msgid "New node {}" msgstr "新节点 {}" -#: assets/api/node.py:241 +#: assets/api/node.py:234 msgid "更新节点资产硬件信息: {}" msgstr "" -#: assets/api/node.py:254 +#: assets/api/node.py:247 msgid "测试节点下资产是否可连接: {}" msgstr "" -#: assets/forms/asset.py:24 assets/models/asset.py:74 assets/models/user.py:103 +#: assets/forms/asset.py:24 assets/models/asset.py:75 assets/models/user.py:103 #: assets/templates/assets/asset_detail.html:183 #: assets/templates/assets/asset_detail.html:191 #: assets/templates/assets/system_user_detail.html:175 perms/models.py:33 @@ -37,7 +37,7 @@ msgid "Nodes" msgstr "节点管理" #: assets/forms/asset.py:27 assets/forms/asset.py:66 assets/forms/asset.py:109 -#: assets/forms/asset.py:113 assets/models/asset.py:79 +#: assets/forms/asset.py:113 assets/models/asset.py:80 #: assets/models/cluster.py:19 assets/models/user.py:72 #: assets/templates/assets/asset_detail.html:73 templates/_nav.html:25 msgid "Admin user" @@ -53,7 +53,7 @@ msgstr "管理用户" msgid "Label" msgstr "标签" -#: assets/forms/asset.py:34 assets/forms/asset.py:73 assets/models/asset.py:70 +#: assets/forms/asset.py:34 assets/forms/asset.py:73 assets/models/asset.py:71 #: assets/models/domain.py:46 msgid "Domain" msgstr "网域" @@ -90,7 +90,7 @@ msgstr "如果有多个的互相隔离的网络,设置资产属于的网域, msgid "Select assets" msgstr "选择资产" -#: assets/forms/asset.py:105 assets/models/asset.py:66 +#: assets/forms/asset.py:105 assets/models/asset.py:67 #: assets/models/domain.py:44 assets/templates/assets/admin_user_assets.html:53 #: assets/templates/assets/asset_detail.html:69 #: assets/templates/assets/domain_gateway_list.html:58 @@ -99,7 +99,7 @@ msgid "Port" msgstr "端口" #: assets/forms/domain.py:14 assets/forms/label.py:13 -#: assets/models/asset.py:229 assets/templates/assets/admin_user_list.html:25 +#: assets/models/asset.py:223 assets/templates/assets/admin_user_list.html:25 #: assets/templates/assets/domain_detail.html:60 #: assets/templates/assets/domain_list.html:15 #: assets/templates/assets/label_list.html:16 @@ -136,8 +136,8 @@ msgstr "资产" #: perms/templates/perms/asset_permission_list.html:53 #: perms/templates/perms/asset_permission_user.html:54 terminal/models.py:16 #: terminal/models.py:154 terminal/templates/terminal/terminal_detail.html:43 -#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14 -#: users/models/user.py:42 users/templates/users/_select_user_modal.html:13 +#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:12 +#: users/models/user.py:49 users/templates/users/_select_user_modal.html:13 #: users/templates/users/user_detail.html:63 #: users/templates/users/user_group_detail.html:55 #: users/templates/users/user_group_list.html:12 @@ -155,7 +155,7 @@ msgstr "名称" #: assets/templates/assets/system_user_list.html:27 #: perms/templates/perms/asset_permission_user.html:55 users/forms.py:13 #: users/forms.py:21 users/forms.py:30 users/models/authentication.py:45 -#: users/models/user.py:40 users/templates/users/_select_user_modal.html:14 +#: users/models/user.py:47 users/templates/users/_select_user_modal.html:14 #: users/templates/users/login.html:56 #: users/templates/users/login_log_list.html:49 #: users/templates/users/user_detail.html:67 @@ -180,7 +180,7 @@ msgstr "密码或密钥密码" msgid "Password" msgstr "密码" -#: assets/forms/user.py:28 users/models/user.py:69 +#: assets/forms/user.py:28 users/models/user.py:76 msgid "Private key" msgstr "ssh私钥" @@ -202,7 +202,7 @@ msgid "" "than 2 system user" msgstr "高优先级的系统用户将会作为默认登录用户" -#: assets/models/asset.py:62 assets/models/domain.py:43 +#: assets/models/asset.py:63 assets/models/domain.py:43 #: assets/templates/assets/_asset_list_modal.html:46 #: assets/templates/assets/admin_user_assets.html:52 #: assets/templates/assets/asset_detail.html:61 @@ -217,7 +217,7 @@ msgstr "高优先级的系统用户将会作为默认登录用户" msgid "IP" msgstr "IP" -#: assets/models/asset.py:65 assets/templates/assets/_asset_list_modal.html:45 +#: assets/models/asset.py:66 assets/templates/assets/_asset_list_modal.html:45 #: assets/templates/assets/admin_user_assets.html:51 #: assets/templates/assets/asset_detail.html:57 #: assets/templates/assets/asset_list.html:86 @@ -229,82 +229,82 @@ msgstr "IP" msgid "Hostname" msgstr "主机名" -#: assets/models/asset.py:68 assets/templates/assets/asset_detail.html:97 +#: assets/models/asset.py:69 assets/templates/assets/asset_detail.html:97 msgid "Platform" msgstr "系统平台" -#: assets/models/asset.py:75 assets/models/domain.py:48 +#: assets/models/asset.py:76 assets/models/domain.py:48 #: assets/models/label.py:20 assets/templates/assets/asset_detail.html:105 msgid "Is active" msgstr "激活" -#: assets/models/asset.py:84 assets/templates/assets/asset_detail.html:65 +#: assets/models/asset.py:85 assets/templates/assets/asset_detail.html:65 msgid "Public IP" msgstr "公网IP" -#: assets/models/asset.py:86 assets/templates/assets/asset_detail.html:113 +#: assets/models/asset.py:87 assets/templates/assets/asset_detail.html:113 msgid "Asset number" msgstr "资产编号" -#: assets/models/asset.py:90 assets/templates/assets/asset_detail.html:77 +#: assets/models/asset.py:91 assets/templates/assets/asset_detail.html:77 msgid "Vendor" msgstr "制造商" -#: assets/models/asset.py:92 assets/templates/assets/asset_detail.html:81 +#: assets/models/asset.py:93 assets/templates/assets/asset_detail.html:81 msgid "Model" msgstr "型号" -#: assets/models/asset.py:94 assets/templates/assets/asset_detail.html:109 +#: assets/models/asset.py:95 assets/templates/assets/asset_detail.html:109 msgid "Serial number" msgstr "序列号" -#: assets/models/asset.py:97 +#: assets/models/asset.py:98 msgid "CPU model" msgstr "CPU型号" -#: assets/models/asset.py:98 +#: assets/models/asset.py:99 msgid "CPU count" msgstr "CPU数量" -#: assets/models/asset.py:99 +#: assets/models/asset.py:100 msgid "CPU cores" msgstr "CPU核数" -#: assets/models/asset.py:101 assets/templates/assets/asset_detail.html:89 +#: assets/models/asset.py:102 assets/templates/assets/asset_detail.html:89 msgid "Memory" msgstr "内存" -#: assets/models/asset.py:103 +#: assets/models/asset.py:104 msgid "Disk total" msgstr "硬盘大小" -#: assets/models/asset.py:105 +#: assets/models/asset.py:106 msgid "Disk info" msgstr "硬盘信息" -#: assets/models/asset.py:108 assets/templates/assets/asset_detail.html:101 +#: assets/models/asset.py:109 assets/templates/assets/asset_detail.html:101 msgid "OS" msgstr "操作系统" -#: assets/models/asset.py:110 +#: assets/models/asset.py:111 msgid "OS version" msgstr "系统版本" -#: assets/models/asset.py:112 +#: assets/models/asset.py:113 msgid "OS arch" msgstr "系统架构" -#: assets/models/asset.py:114 +#: assets/models/asset.py:115 msgid "Hostname raw" msgstr "主机名原始" -#: assets/models/asset.py:118 assets/templates/assets/asset_create.html:33 +#: assets/models/asset.py:119 assets/templates/assets/asset_create.html:33 #: assets/templates/assets/asset_detail.html:220 #: assets/templates/assets/asset_update.html:38 templates/_nav.html:27 msgid "Labels" msgstr "标签管理" -#: assets/models/asset.py:120 assets/models/base.py:29 +#: assets/models/asset.py:121 assets/models/base.py:29 #: assets/models/cluster.py:28 assets/models/group.py:21 #: assets/templates/assets/admin_user_detail.html:68 #: assets/templates/assets/asset_detail.html:117 @@ -312,11 +312,11 @@ msgstr "标签管理" #: assets/templates/assets/system_user_detail.html:96 #: ops/templates/ops/adhoc_detail.html:86 perms/models.py:38 perms/models.py:81 #: perms/templates/perms/asset_permission_detail.html:98 -#: users/models/user.py:83 users/templates/users/user_detail.html:107 +#: users/models/user.py:90 users/templates/users/user_detail.html:111 msgid "Created by" msgstr "创建者" -#: assets/models/asset.py:123 assets/models/cluster.py:26 +#: assets/models/asset.py:124 assets/models/cluster.py:26 #: assets/models/domain.py:20 assets/models/group.py:22 #: assets/models/label.py:23 assets/templates/assets/admin_user_detail.html:64 #: assets/templates/assets/domain_detail.html:68 @@ -324,12 +324,12 @@ msgstr "创建者" #: ops/templates/ops/adhoc_detail.html:90 ops/templates/ops/task_detail.html:63 #: perms/models.py:39 perms/models.py:82 #: perms/templates/perms/asset_permission_detail.html:94 -#: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:17 +#: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:15 #: users/templates/users/user_group_detail.html:63 msgid "Date created" msgstr "创建日期" -#: assets/models/asset.py:125 assets/models/base.py:26 +#: assets/models/asset.py:126 assets/models/base.py:26 #: assets/models/cluster.py:29 assets/models/domain.py:18 #: assets/models/domain.py:47 assets/models/group.py:23 #: assets/models/label.py:21 assets/templates/assets/admin_user_detail.html:72 @@ -342,11 +342,11 @@ msgstr "创建日期" #: assets/templates/assets/system_user_list.html:33 common/models.py:30 #: ops/models/adhoc.py:42 perms/models.py:40 perms/models.py:83 #: perms/templates/perms/asset_permission_detail.html:102 terminal/models.py:26 -#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:15 -#: users/models/user.py:75 users/templates/users/user_detail.html:119 +#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:13 +#: users/models/user.py:82 users/templates/users/user_detail.html:123 #: users/templates/users/user_group_detail.html:67 #: users/templates/users/user_group_list.html:14 -#: users/templates/users/user_profile.html:126 +#: users/templates/users/user_profile.html:130 msgid "Comment" msgstr "备注" @@ -366,7 +366,7 @@ msgstr "带宽" msgid "Contact" msgstr "联系人" -#: assets/models/cluster.py:22 users/models/user.py:61 +#: assets/models/cluster.py:22 users/models/user.py:68 #: users/templates/users/user_detail.html:76 msgid "Phone" msgstr "手机" @@ -392,7 +392,7 @@ msgid "Default" msgstr "默认" #: assets/models/cluster.py:36 assets/models/label.py:13 -#: users/models/user.py:330 +#: users/models/user.py:347 msgid "System" msgstr "系统" @@ -432,9 +432,9 @@ msgstr "默认资产组" #: terminal/templates/terminal/command_list.html:72 #: terminal/templates/terminal/session_list.html:33 #: terminal/templates/terminal/session_list.html:71 users/forms.py:281 -#: users/models/user.py:30 users/models/user.py:318 +#: users/models/user.py:31 users/models/user.py:335 #: users/templates/users/user_group_detail.html:78 -#: users/templates/users/user_group_list.html:13 users/views/user.py:360 +#: users/templates/users/user_group_list.html:13 users/views/user.py:359 msgid "User" msgstr "用户" @@ -640,7 +640,7 @@ msgstr "其它" #: users/templates/users/_user.html:46 #: users/templates/users/user_bulk_update.html:23 #: users/templates/users/user_password_update.html:70 -#: users/templates/users/user_profile.html:184 +#: users/templates/users/user_profile.html:188 #: users/templates/users/user_profile_update.html:63 #: users/templates/users/user_pubkey_update.html:70 #: users/templates/users/user_pubkey_update.html:76 @@ -667,7 +667,7 @@ msgstr "重置" #: users/templates/users/_user.html:47 #: users/templates/users/forgot_password.html:44 #: users/templates/users/user_bulk_update.html:24 -#: users/templates/users/user_list.html:44 +#: users/templates/users/user_list.html:45 #: users/templates/users/user_password_update.html:71 #: users/templates/users/user_profile_update.html:64 #: users/templates/users/user_pubkey_update.html:77 @@ -744,9 +744,9 @@ msgstr "测试" #: users/templates/users/user_detail.html:25 #: 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:147 -#: users/templates/users/user_profile.html:176 +#: users/templates/users/user_list.html:77 +#: users/templates/users/user_profile.html:151 +#: users/templates/users/user_profile.html:180 msgid "Update" msgstr "更新" @@ -768,8 +768,8 @@ msgstr "更新" #: users/templates/users/user_detail.html:30 #: users/templates/users/user_group_detail.html:32 #: users/templates/users/user_group_list.html:45 -#: users/templates/users/user_list.html:80 -#: users/templates/users/user_list.html:84 +#: users/templates/users/user_list.html:81 +#: users/templates/users/user_list.html:85 msgid "Delete" msgstr "删除" @@ -784,17 +784,17 @@ msgstr "选择节点" #: assets/templates/assets/admin_user_detail.html:100 #: assets/templates/assets/asset_detail.html:200 -#: assets/templates/assets/asset_list.html:639 +#: assets/templates/assets/asset_list.html:638 #: assets/templates/assets/system_user_detail.html:192 #: assets/templates/assets/system_user_list.html:138 templates/_modal.html:22 #: terminal/templates/terminal/session_detail.html:108 -#: users/templates/users/user_detail.html:362 -#: users/templates/users/user_detail.html:387 -#: users/templates/users/user_detail.html:410 +#: users/templates/users/user_detail.html:366 +#: users/templates/users/user_detail.html:391 +#: users/templates/users/user_detail.html:414 #: users/templates/users/user_group_create_update.html:32 #: users/templates/users/user_group_list.html:86 -#: users/templates/users/user_list.html:199 -#: users/templates/users/user_profile.html:218 +#: users/templates/users/user_list.html:200 +#: users/templates/users/user_profile.html:222 msgid "Confirm" msgstr "确认" @@ -827,7 +827,7 @@ msgstr "比例" #: terminal/templates/terminal/session_list.html:80 #: terminal/templates/terminal/terminal_list.html:36 #: users/templates/users/user_group_list.html:15 -#: users/templates/users/user_list.html:28 +#: users/templates/users/user_list.html:29 msgid "Action" msgstr "动作" @@ -844,15 +844,15 @@ msgid "Disk" msgstr "硬盘" #: assets/templates/assets/asset_detail.html:121 -#: users/templates/users/user_detail.html:111 -#: users/templates/users/user_profile.html:100 +#: users/templates/users/user_detail.html:115 +#: users/templates/users/user_profile.html:104 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:138 +#: users/templates/users/user_detail.html:134 +#: users/templates/users/user_profile.html:142 msgid "Quick modify" msgstr "快速修改" @@ -865,10 +865,10 @@ msgstr "快速修改" #: perms/templates/perms/asset_permission_list.html:59 #: terminal/templates/terminal/terminal_list.html:34 #: users/templates/users/_select_user_modal.html:18 -#: users/templates/users/user_detail.html:136 +#: users/templates/users/user_detail.html:140 #: users/templates/users/user_granted_asset.html:46 #: users/templates/users/user_group_granted_asset.html:46 -#: users/templates/users/user_list.html:27 +#: users/templates/users/user_list.html:28 #: users/templates/users/user_profile.html:63 msgid "Active" msgstr "激活中" @@ -882,8 +882,8 @@ msgid "Refresh" msgstr "刷新" #: assets/templates/assets/asset_detail.html:300 -#: users/templates/users/user_detail.html:282 -#: users/templates/users/user_detail.html:309 +#: users/templates/users/user_detail.html:286 +#: users/templates/users/user_detail.html:313 msgid "Update successfully!" msgstr "更新成功" @@ -906,12 +906,12 @@ msgid "Hardware" msgstr "硬件" #: assets/templates/assets/asset_list.html:100 -#: users/templates/users/user_list.html:37 +#: users/templates/users/user_list.html:38 msgid "Delete selected" msgstr "批量删除" #: assets/templates/assets/asset_list.html:101 -#: users/templates/users/user_list.html:38 +#: users/templates/users/user_list.html:39 msgid "Update selected" msgstr "批量更新" @@ -920,12 +920,12 @@ msgid "Remove from this node" msgstr "从节点移除" #: assets/templates/assets/asset_list.html:103 -#: users/templates/users/user_list.html:39 +#: users/templates/users/user_list.html:40 msgid "Deactive selected" msgstr "禁用所选" #: assets/templates/assets/asset_list.html:104 -#: users/templates/users/user_list.html:40 +#: users/templates/users/user_list.html:41 msgid "Active selected" msgstr "激活所选" @@ -977,29 +977,29 @@ msgstr "存在子节点,不能删除" msgid "Have assets, cancel" msgstr "存在资产,不能删除" -#: assets/templates/assets/asset_list.html:634 +#: assets/templates/assets/asset_list.html:633 #: assets/templates/assets/system_user_list.html:133 -#: users/templates/users/user_detail.html:357 -#: users/templates/users/user_detail.html:382 +#: users/templates/users/user_detail.html:361 +#: users/templates/users/user_detail.html:386 #: users/templates/users/user_group_list.html:81 -#: users/templates/users/user_list.html:194 +#: users/templates/users/user_list.html:195 msgid "Are you sure?" msgstr "你确认吗?" -#: assets/templates/assets/asset_list.html:635 +#: assets/templates/assets/asset_list.html:634 msgid "This will delete the selected assets !!!" msgstr "删除选择资产" -#: assets/templates/assets/asset_list.html:643 +#: assets/templates/assets/asset_list.html:642 msgid "Asset Deleted." msgstr "已被删除" -#: assets/templates/assets/asset_list.html:644 -#: assets/templates/assets/asset_list.html:649 +#: assets/templates/assets/asset_list.html:643 +#: assets/templates/assets/asset_list.html:648 msgid "Asset Delete" msgstr "删除" -#: assets/templates/assets/asset_list.html:648 +#: assets/templates/assets/asset_list.html:647 msgid "Asset Deleting failed." msgstr "删除失败" @@ -1239,11 +1239,11 @@ msgstr "FTP日志" msgid "Test mail sent to {}, please check" msgstr "邮件已经发送{}, 请检查" -#: common/api.py:52 +#: common/api.py:42 msgid "Test ldap success" msgstr "连接LDAP成功" -#: common/api.py:90 +#: common/api.py:80 msgid "Match {} s users" msgstr "匹配 {} 个用户" @@ -1414,41 +1414,41 @@ msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有 msgid "Password minimum length" msgstr "密码最小长度 " -#: common/forms.py:190 +#: common/forms.py:191 msgid "Must contain capital letters" msgstr "必须包含大写字母" -#: common/forms.py:192 +#: common/forms.py:193 msgid "" "After opening, the user password changes and resets must contain uppercase " "letters" msgstr "开启后,用户密码修改、重置必须包含大写字母" -#: common/forms.py:198 +#: common/forms.py:199 msgid "Must contain lowercase letters" msgstr "必须包含小写字母" -#: common/forms.py:199 +#: common/forms.py:200 msgid "" "After opening, the user password changes and resets must contain lowercase " "letters" msgstr "开启后,用户密码修改、重置必须包含小写字母" -#: common/forms.py:205 +#: common/forms.py:206 msgid "Must contain numeric characters" msgstr "必须包含数字字符" -#: common/forms.py:206 +#: common/forms.py:207 msgid "" "After opening, the user password changes and resets must contain numeric " "characters" msgstr "开启后,用户密码修改、重置必须包含数字字符" -#: common/forms.py:212 +#: common/forms.py:213 msgid "Must contain special characters" msgstr "必须包含特殊字符" -#: common/forms.py:213 +#: common/forms.py:214 msgid "" "After opening, the user password changes and resets must contain special " "characters" @@ -1813,9 +1813,9 @@ msgstr "选择用户" #: perms/forms.py:34 perms/models.py:31 perms/models.py:77 #: perms/templates/perms/asset_permission_list.html:55 #: perms/templates/perms/asset_permission_list.html:136 templates/_nav.html:14 -#: users/models/group.py:25 users/models/user.py:48 +#: users/models/group.py:23 users/models/user.py:55 #: users/templates/users/_select_user_modal.html:16 -#: users/templates/users/user_detail.html:188 +#: users/templates/users/user_detail.html:192 #: users/templates/users/user_list.html:26 msgid "User group" msgstr "用户组" @@ -1830,8 +1830,8 @@ msgstr "" #: perms/models.py:37 perms/models.py:80 #: perms/templates/perms/asset_permission_detail.html:90 -#: users/models/user.py:80 users/templates/users/user_detail.html:103 -#: users/templates/users/user_profile.html:108 +#: users/models/user.py:87 users/templates/users/user_detail.html:107 +#: users/templates/users/user_profile.html:112 msgid "Date expired" msgstr "失效日期" @@ -1868,7 +1868,7 @@ msgid "Add node to this permission" msgstr "添加节点" #: perms/templates/perms/asset_permission_asset.html:125 -#: users/templates/users/user_detail.html:205 +#: users/templates/users/user_detail.html:209 msgid "Join" msgstr "加入" @@ -1965,7 +1965,7 @@ msgstr "文档" #: users/templates/users/user_profile.html:17 #: users/templates/users/user_profile_update.html:37 #: users/templates/users/user_profile_update.html:57 -#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:342 +#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:341 msgid "Profile" msgstr "个人信息" @@ -2022,9 +2022,9 @@ msgstr "关闭" #: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44 #: users/views/group.py:62 users/views/group.py:79 users/views/group.py:95 -#: users/views/login.py:284 users/views/login.py:342 users/views/user.py:65 +#: users/views/login.py:277 users/views/login.py:335 users/views/user.py:65 #: users/views/user.py:80 users/views/user.py:102 users/views/user.py:173 -#: users/views/user.py:328 users/views/user.py:379 users/views/user.py:414 +#: users/views/user.py:328 users/views/user.py:378 users/views/user.py:413 msgid "Users" msgstr "用户管理" @@ -2338,7 +2338,7 @@ msgstr "" msgid "MFA code" msgstr "MFA 验证码" -#: users/forms.py:49 users/models/user.py:52 +#: users/forms.py:49 users/models/user.py:59 #: users/templates/users/_select_user_modal.html:15 #: users/templates/users/user_detail.html:87 #: users/templates/users/user_list.html:25 @@ -2358,7 +2358,7 @@ msgstr "" msgid "Paste user id_rsa.pub here." msgstr "复制用户公钥到这里" -#: users/forms.py:72 users/templates/users/user_detail.html:196 +#: users/forms.py:72 users/templates/users/user_detail.html:200 msgid "Join user groups" msgstr "添加到用户组" @@ -2366,7 +2366,7 @@ msgstr "添加到用户组" msgid "Public key should not be the same as your old one." msgstr "不能和原来的密钥相同" -#: users/forms.py:87 users/forms.py:220 users/serializers.py:45 +#: users/forms.py:87 users/forms.py:220 users/serializers.py:48 msgid "Not a valid ssh public key" msgstr "ssh密钥不合法" @@ -2383,7 +2383,7 @@ msgstr "" msgid "* Enable MFA authentication to make the account more secure." msgstr "* 启用MFA认证,使账号更加安全." -#: users/forms.py:142 users/models/user.py:64 +#: users/forms.py:142 users/models/user.py:71 #: users/templates/users/first_login.html:45 msgid "MFA" msgstr "MFA" @@ -2431,7 +2431,7 @@ msgstr "自动配置并下载SSH密钥" msgid "Paste your id_rsa.pub here." msgstr "复制你的公钥到这里" -#: users/forms.py:231 users/models/user.py:72 +#: users/forms.py:231 users/models/user.py:79 #: users/templates/users/first_login.html:42 #: users/templates/users/user_password_update.html:45 #: users/templates/users/user_profile.html:68 @@ -2464,43 +2464,49 @@ msgstr "Agent" msgid "Date login" msgstr "登录日期" -#: users/models/user.py:29 users/models/user.py:326 +#: users/models/user.py:30 users/models/user.py:343 msgid "Administrator" msgstr "管理员" -#: users/models/user.py:31 +#: users/models/user.py:32 msgid "Application" msgstr "应用程序" -#: users/models/user.py:34 users/templates/users/user_profile.html:92 -#: users/templates/users/user_profile.html:159 -#: users/templates/users/user_profile.html:162 +#: users/models/user.py:35 users/templates/users/user_profile.html:92 +#: users/templates/users/user_profile.html:163 +#: users/templates/users/user_profile.html:166 msgid "Disable" msgstr "禁用" -#: users/models/user.py:35 users/templates/users/user_profile.html:90 -#: users/templates/users/user_profile.html:166 +#: users/models/user.py:36 users/templates/users/user_profile.html:90 +#: users/templates/users/user_profile.html:170 msgid "Enable" msgstr "启用" -#: users/models/user.py:36 users/templates/users/user_profile.html:88 +#: users/models/user.py:37 users/templates/users/user_profile.html:88 msgid "Force enable" msgstr "强制启用" -#: users/models/user.py:44 users/templates/users/user_detail.html:71 +#: users/models/user.py:51 users/templates/users/user_detail.html:71 #: users/templates/users/user_profile.html:59 msgid "Email" msgstr "邮件" -#: users/models/user.py:55 +#: users/models/user.py:62 msgid "Avatar" msgstr "头像" -#: users/models/user.py:58 users/templates/users/user_detail.html:82 +#: users/models/user.py:65 users/templates/users/user_detail.html:82 msgid "Wechat" msgstr "微信" -#: users/models/user.py:329 +#: users/models/user.py:94 users/templates/users/user_detail.html:103 +#: users/templates/users/user_list.html:27 +#: users/templates/users/user_profile.html:100 +msgid "Source" +msgstr "用户来源" + +#: users/models/user.py:346 msgid "Administrator is the super user of system" msgstr "Administrator是初始的超级管理员" @@ -2617,7 +2623,7 @@ msgid "Can't provide security? Please contact the administrator!" msgstr "如果不能提供MFA验证码,请联系管理员!" #: users/templates/users/reset_password.html:46 -#: users/templates/users/user_detail.html:348 users/utils.py:80 +#: users/templates/users/user_detail.html:352 users/utils.py:80 msgid "Reset password" msgstr "重置密码" @@ -2671,63 +2677,63 @@ msgstr "强制启用" msgid "Disabled" msgstr "禁用" -#: users/templates/users/user_detail.html:115 -#: users/templates/users/user_profile.html:104 +#: users/templates/users/user_detail.html:119 +#: users/templates/users/user_profile.html:108 msgid "Last login" msgstr "最后登录" -#: users/templates/users/user_detail.html:151 +#: users/templates/users/user_detail.html:155 msgid "Force enabled MFA" msgstr "强制启用MFA" -#: users/templates/users/user_detail.html:166 +#: users/templates/users/user_detail.html:170 msgid "Send reset password mail" msgstr "发送重置密码邮件" -#: users/templates/users/user_detail.html:169 -#: users/templates/users/user_detail.html:177 +#: users/templates/users/user_detail.html:173 +#: users/templates/users/user_detail.html:181 msgid "Send" msgstr "发送" -#: users/templates/users/user_detail.html:174 +#: users/templates/users/user_detail.html:178 msgid "Send reset ssh key mail" msgstr "发送重置密钥邮件" -#: users/templates/users/user_detail.html:291 +#: users/templates/users/user_detail.html:295 msgid "Goto profile page enable MFA" msgstr "请去个人信息页面启用自己的MFA" -#: users/templates/users/user_detail.html:347 +#: users/templates/users/user_detail.html:351 msgid "An e-mail has been sent to the user`s mailbox." msgstr "已发送邮件到用户邮箱" -#: users/templates/users/user_detail.html:358 +#: users/templates/users/user_detail.html:362 msgid "This will reset the user password and send a reset mail" msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱" -#: users/templates/users/user_detail.html:372 +#: users/templates/users/user_detail.html:376 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:373 +#: users/templates/users/user_detail.html:377 msgid "Reset SSH public key" msgstr "重置SSH密钥" -#: users/templates/users/user_detail.html:383 +#: users/templates/users/user_detail.html:387 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:207 +#: users/templates/users/user_detail.html:404 +#: users/templates/users/user_profile.html:211 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:208 -#: users/templates/users/user_profile.html:213 +#: users/templates/users/user_detail.html:409 +#: users/templates/users/user_profile.html:212 +#: users/templates/users/user_profile.html:217 msgid "User SSH public key update" msgstr "ssh密钥" @@ -2766,20 +2772,20 @@ msgstr "用户组删除" msgid "UserGroup Deleting failed." msgstr "用户组删除失败" -#: users/templates/users/user_list.html:195 +#: users/templates/users/user_list.html:196 msgid "This will delete the selected users !!!" msgstr "删除选中用户 !!!" -#: users/templates/users/user_list.html:203 +#: users/templates/users/user_list.html:204 msgid "User Deleted." msgstr "已被删除" -#: users/templates/users/user_list.html:204 -#: users/templates/users/user_list.html:209 +#: users/templates/users/user_list.html:205 +#: users/templates/users/user_list.html:210 msgid "User Delete" msgstr "删除" -#: users/templates/users/user_list.html:208 +#: users/templates/users/user_list.html:209 msgid "User Deleting failed." msgstr "用户删除失败" @@ -2787,28 +2793,28 @@ msgstr "用户删除失败" msgid "Administrator Settings force MFA login" msgstr "管理员设置强制使用MFA登录" -#: users/templates/users/user_profile.html:112 users/views/user.py:203 +#: users/templates/users/user_profile.html:116 users/views/user.py:203 #: users/views/user.py:257 msgid "User groups" msgstr "用户组" -#: users/templates/users/user_profile.html:144 +#: users/templates/users/user_profile.html:148 msgid "Update password" msgstr "更改密码" -#: users/templates/users/user_profile.html:152 +#: users/templates/users/user_profile.html:156 msgid "Update MFA settings" msgstr "更改MFA设置" -#: users/templates/users/user_profile.html:173 +#: users/templates/users/user_profile.html:177 msgid "Update SSH public key" msgstr "更改SSH密钥" -#: users/templates/users/user_profile.html:181 +#: users/templates/users/user_profile.html:185 msgid "Reset public key and download" msgstr "重置并下载SSH密钥" -#: users/templates/users/user_profile.html:211 +#: users/templates/users/user_profile.html:215 msgid "Failed to update SSH public key." msgstr "更新密钥失败" @@ -2986,56 +2992,56 @@ msgstr "用户组授权资产" msgid "Please enable cookies and try again." msgstr "设置你的浏览器支持cookie" -#: users/views/login.py:135 users/views/user.py:499 users/views/user.py:524 +#: users/views/login.py:128 users/views/user.py:498 users/views/user.py:523 msgid "MFA code invalid" msgstr "MFA码认证失败" -#: users/views/login.py:161 +#: users/views/login.py:154 msgid "Logout success" msgstr "退出登录成功" -#: users/views/login.py:162 +#: users/views/login.py:155 msgid "Logout success, return login page" msgstr "退出登录成功,返回到登录页面" -#: users/views/login.py:178 +#: users/views/login.py:171 msgid "Email address invalid, please input again" msgstr "邮箱地址错误,重新输入" -#: users/views/login.py:191 +#: users/views/login.py:184 msgid "Send reset password message" msgstr "发送重置密码邮件" -#: users/views/login.py:192 +#: users/views/login.py:185 msgid "Send reset password mail success, login your mail box and follow it " msgstr "" "发送重置邮件成功, 请登录邮箱查看, 按照提示操作 (如果没收到,请等待3-5分钟)" -#: users/views/login.py:205 +#: users/views/login.py:198 msgid "Reset password success" msgstr "重置密码成功" -#: users/views/login.py:206 +#: users/views/login.py:199 msgid "Reset password success, return to login page" msgstr "重置密码成功,返回到登录页面" -#: users/views/login.py:227 users/views/login.py:240 +#: users/views/login.py:220 users/views/login.py:233 msgid "Token invalid or expired" msgstr "Token错误或失效" -#: users/views/login.py:236 +#: users/views/login.py:229 msgid "Password not same" msgstr "密码不一致" -#: users/views/login.py:246 users/views/user.py:115 users/views/user.py:397 +#: users/views/login.py:239 users/views/user.py:115 users/views/user.py:396 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" -#: users/views/login.py:284 +#: users/views/login.py:277 msgid "First login" msgstr "首次登陆" -#: users/views/login.py:343 +#: users/views/login.py:336 msgid "Login log list" msgstr "登录日志" @@ -3051,34 +3057,34 @@ msgstr "文件不合法" msgid "User granted assets" msgstr "用户授权资产" -#: users/views/user.py:361 +#: users/views/user.py:360 msgid "Profile setting" msgstr "个人信息设置" -#: users/views/user.py:380 +#: users/views/user.py:379 msgid "Password update" msgstr "密码更新" -#: users/views/user.py:415 +#: users/views/user.py:414 msgid "Public key update" msgstr "密钥更新" -#: users/views/user.py:456 +#: users/views/user.py:455 msgid "Password invalid" msgstr "用户名或密码无效" -#: users/views/user.py:550 +#: users/views/user.py:549 msgid "MFA enable success" msgstr "MFA 绑定成功" -#: users/views/user.py:551 +#: users/views/user.py:550 msgid "MFA enable success, return login page" msgstr "MFA 绑定成功,返回到登录页面" -#: users/views/user.py:553 +#: users/views/user.py:552 msgid "MFA disable success" msgstr "MFA 解绑成功" -#: users/views/user.py:554 +#: users/views/user.py:553 msgid "MFA disable success, return login page" msgstr "MFA 解绑成功,返回登录页面" diff --git a/apps/users/models/user.py b/apps/users/models/user.py index fa01ba82c..d69151f55 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -36,6 +36,12 @@ class User(AbstractUser): (1, _('Enable')), (2, _("Force enable")), ) + SOURCE_LOCAL = 'local' + SOURCE_LDAP = 'ldap' + SOURCE_CHOICES = ( + (SOURCE_LOCAL, 'Local'), + (SOURCE_LDAP, 'LDAP/AD'), + ) id = models.UUIDField(default=uuid.uuid4, primary_key=True) username = models.CharField( max_length=128, unique=True, verbose_name=_('Username') @@ -83,6 +89,10 @@ class User(AbstractUser): created_by = models.CharField( max_length=30, default='', verbose_name=_('Created by') ) + source = models.CharField( + max_length=30, default=SOURCE_LOCAL, choices=SOURCE_CHOICES, + verbose_name=_('Source') + ) def __str__(self): return '{0.name}({0.username})'.format(self) @@ -259,7 +269,7 @@ class User(AbstractUser): return self.otp_level == 2 def enable_otp(self): - if not self.otp_force_enabled: + if not self.otp_level == 2: self.otp_level = 1 def force_enable_otp(self): @@ -279,6 +289,7 @@ class User(AbstractUser): 'is_superuser': self.is_superuser, 'role': self.get_role_display(), 'groups': [group.name for group in self.groups.all()], + 'source': self.get_source_display(), 'wechat': self.wechat, 'phone': self.phone, 'otp_level': self.otp_level, diff --git a/apps/users/serializers.py b/apps/users/serializers.py index f1347b0d5..d3f3eb73f 100644 --- a/apps/users/serializers.py +++ b/apps/users/serializers.py @@ -26,7 +26,10 @@ class UserSerializer(BulkSerializerMixin, serializers.ModelSerializer): def get_field_names(self, declared_fields, info): fields = super(UserSerializer, self).get_field_names(declared_fields, info) - fields.extend(['groups_display', 'get_role_display', 'is_valid']) + fields.extend([ + 'groups_display', 'get_role_display', + 'get_source_display', 'is_valid' + ]) return fields @staticmethod diff --git a/apps/users/signals_handler.py b/apps/users/signals_handler.py index 4c6afc663..bae5e37cd 100644 --- a/apps/users/signals_handler.py +++ b/apps/users/signals_handler.py @@ -2,6 +2,7 @@ # from django.dispatch import receiver +from django_auth_ldap.backend import populate_user # from django.db.models.signals import post_save from common.utils import get_logger @@ -28,3 +29,11 @@ def on_user_create(sender, user=None, **kwargs): logger.info(" - Sending welcome mail ...".format(user.name)) if user.email: send_user_created_mail(user) + + +@receiver(populate_user) +def on_ldap_create_user(sender, user, ldap_user, **kwargs): + if user: + user.source = user.SOURCE_LDAP + user.save() + diff --git a/apps/users/templates/users/user_detail.html b/apps/users/templates/users/user_detail.html index 66bfa61e0..22ab4b5d4 100644 --- a/apps/users/templates/users/user_detail.html +++ b/apps/users/templates/users/user_detail.html @@ -99,6 +99,10 @@ {% endif %} + + {% trans 'Source' %}: + {{ user_object.get_source_display }} + {% trans 'Date expired' %}: {{ user_object.date_expired|date:"Y-m-j H:i:s" }} diff --git a/apps/users/templates/users/user_list.html b/apps/users/templates/users/user_list.html index c7c9b8b28..052c5b7c0 100644 --- a/apps/users/templates/users/user_list.html +++ b/apps/users/templates/users/user_list.html @@ -24,6 +24,7 @@ {% trans 'Username' %} {% trans 'Role' %} {% trans 'User group' %} + {% trans 'Source' %} {% trans 'Active' %} {% trans 'Action' %} @@ -65,14 +66,14 @@ function initTable() { var innerHtml = cellData.length > 20 ? cellData.substring(0, 20) + '...': cellData; $(td).html('' + innerHtml + ''); }}, - {targets: 5, createdCell: function (td, cellData) { + {targets: 6, createdCell: function (td, cellData) { if (!cellData) { $(td).html('') } else { $(td).html('') } }}, - {targets: 6, createdCell: function (td, cellData, rowData) { + {targets: 7, createdCell: function (td, cellData, rowData) { var update_btn = '{% trans "Update" %}'.replace('00000000-0000-0000-0000-000000000000', cellData); var del_btn = ""; @@ -90,7 +91,7 @@ function initTable() { ajax_url: '{% url "api-users:user-list" %}', columns: [ {data: "id"}, {data: "name" }, {data: "username" }, {data: "get_role_display" }, - {data: "groups_display" }, {data: "is_valid" }, {data: "id" } + {data: "groups_display" }, {data: "get_source_display" }, {data: "is_valid" }, {data: "id" } ], op_html: $('#actions').html() }; diff --git a/apps/users/templates/users/user_profile.html b/apps/users/templates/users/user_profile.html index 50dabeabc..0109203df 100644 --- a/apps/users/templates/users/user_profile.html +++ b/apps/users/templates/users/user_profile.html @@ -96,6 +96,10 @@ {% endif %} + + {% trans 'Source' %} + {{ user.get_source_display }} + {% trans 'Date joined' %} {{ user.date_joined|date:"Y-m-d H:i:s" }} diff --git a/apps/users/views/login.py b/apps/users/views/login.py index c058b4402..feaf47e89 100644 --- a/apps/users/views/login.py +++ b/apps/users/views/login.py @@ -83,10 +83,10 @@ class UserLoginView(FormView): user = get_user_or_tmp_user(self.request) if user.otp_enabled and user.otp_secret_key: - # 1,2 & T + # 1,2,mfa_setting & T return reverse('users:login-otp') elif user.otp_enabled and not user.otp_secret_key: - # 1,2 & F + # 1,2,mfa_setting & F return reverse('users:user-otp-enable-authentication') elif not user.otp_enabled: # 0 & T,F