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
b237cbb2
Commit
b237cbb2
authored
May 24, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
9b5b48dd
b7eac837
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
613 additions
and
275 deletions
+613
-275
const.py
apps/applications/const.py
+1
-1
remote_app.py
apps/applications/forms/remote_app.py
+21
-0
remote_app_create_update.html
...ions/templates/applications/remote_app_create_update.html
+41
-8
ldap.py
apps/authentication/backends/ldap.py
+16
-9
settings.py
apps/jumpserver/settings.py
+6
-0
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+262
-160
user_permission.py
apps/perms/api/user_permission.py
+1
-0
api.py
apps/settings/api.py
+4
-4
forms.py
apps/settings/forms.py
+23
-0
_ldap_list_users_modal.html
apps/settings/templates/settings/_ldap_list_users_modal.html
+3
-0
basic_setting.html
apps/settings/templates/settings/basic_setting.html
+3
-0
email_content_setting.html
apps/settings/templates/settings/email_content_setting.html
+72
-0
email_setting.html
apps/settings/templates/settings/email_setting.html
+3
-0
ldap_setting.html
apps/settings/templates/settings/ldap_setting.html
+8
-5
security_setting.html
apps/settings/templates/settings/security_setting.html
+3
-0
terminal_setting.html
apps/settings/templates/settings/terminal_setting.html
+3
-0
view_urls.py
apps/settings/urls/view_urls.py
+1
-0
utils.py
apps/settings/utils.py
+61
-64
views.py
apps/settings/views.py
+27
-1
utils.py
apps/users/utils.py
+54
-23
No files found.
apps/applications/const.py
View file @
b237cbb2
...
@@ -28,7 +28,7 @@ REMOTE_APP_TYPE_CHOICES = (
...
@@ -28,7 +28,7 @@ REMOTE_APP_TYPE_CHOICES = (
(
(
_
(
'Virtualization tools'
),
_
(
'Virtualization tools'
),
(
(
(
REMOTE_APP_TYPE_VMWARE_CLIENT
,
'
VMwa
re Client'
),
(
REMOTE_APP_TYPE_VMWARE_CLIENT
,
'
vSphe
re Client'
),
)
)
),
),
(
REMOTE_APP_TYPE_CUSTOM
,
_
(
'Custom'
)),
(
REMOTE_APP_TYPE_CUSTOM
,
_
(
'Custom'
)),
...
...
apps/applications/forms/remote_app.py
View file @
b237cbb2
...
@@ -8,6 +8,7 @@ from orgs.mixins import OrgModelForm
...
@@ -8,6 +8,7 @@ from orgs.mixins import OrgModelForm
from
assets.models
import
Asset
,
SystemUser
from
assets.models
import
Asset
,
SystemUser
from
..models
import
RemoteApp
from
..models
import
RemoteApp
from
..
import
const
__all__
=
[
__all__
=
[
...
@@ -109,3 +110,23 @@ class RemoteAppCreateUpdateForm(RemoteAppTypeForms, OrgModelForm):
...
@@ -109,3 +110,23 @@ class RemoteAppCreateUpdateForm(RemoteAppTypeForms, OrgModelForm):
})
})
}
}
def
_clean_params
(
self
):
app_type
=
self
.
data
.
get
(
'type'
)
fields
=
const
.
REMOTE_APP_TYPE_MAP_FIELDS
.
get
(
app_type
,
[])
params
=
{}
for
field
in
fields
:
name
=
field
[
'name'
]
value
=
self
.
cleaned_data
[
name
]
params
.
update
({
name
:
value
})
return
params
def
_save_params
(
self
,
instance
):
params
=
self
.
_clean_params
()
instance
.
params
=
params
instance
.
save
()
return
instance
def
save
(
self
,
commit
=
True
):
instance
=
super
()
.
save
(
commit
=
commit
)
instance
=
self
.
_save_params
(
instance
)
return
instance
apps/applications/templates/applications/remote_app_create_update.html
View file @
b237cbb2
...
@@ -64,28 +64,60 @@
...
@@ -64,28 +64,60 @@
{% block custom_foot_js %}
{% block custom_foot_js %}
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
type_id
=
'#'
+
'{{ form.type.id_for_label }}'
;
var
app_type_id
=
'#'
+
'{{ form.type.id_for_label }}'
;
var
app_path_id
=
'#'
+
'{{ form.path.id_for_label }}'
;
var
all_type_fields
=
[
var
all_type_fields
=
[
'.chrome-fields'
,
'.chrome-fields'
,
'.mysql_workbench-fields'
,
'.mysql_workbench-fields'
,
'.vmware_client-fields'
,
'.vmware_client-fields'
,
'.custom-fields'
'.custom-fields'
];
];
function
appTypeChange
(){
var
app_type_map_default_fields_value
=
{
'chrome'
:
{
'app_path'
:
'C:
\\
Program Files (x86)
\\
Google
\\
Chrome
\\
Application
\\
chrome.exe'
},
'mysql_workbench'
:
{
'app_path'
:
'C:
\\
Program Files
\\
MySQL
\\
MySQL Workbench 8.0 CE
\\
MySQLWorkbench.exe'
},
'vmware_client'
:
{
'app_path'
:
'C:
\\
Program Files (x86)
\\
VMware
\\
Infrastructure
\\
Virtual Infrastructure Client
\\
Launcher
\\
VpxClient.exe'
},
'custom'
:
{
'app_path'
:
''
}
};
function
getAppType
(){
return
$
(
app_type_id
+
" option:selected"
).
val
();
}
function
initialDefaultValue
(){
var
app_type
=
getAppType
();
var
app_path
=
$
(
app_path_id
).
val
();
if
(
app_path
){
app_type_map_default_fields_value
[
app_type
][
'app_path'
]
=
app_path
}
}
function
setDefaultValue
(){
// 设置类型相关字段的默认值
var
app_type
=
getAppType
();
var
app_path
=
app_type_map_default_fields_value
[
app_type
][
'app_path'
];
$
(
app_path_id
).
val
(
app_path
)
}
function
hiddenFields
(){
var
app_type
=
getAppType
();
$
.
each
(
all_type_fields
,
function
(
index
,
value
){
$
.
each
(
all_type_fields
,
function
(
index
,
value
){
$
(
value
).
addClass
(
'hidden'
)
$
(
value
).
addClass
(
'hidden'
)
});
});
var
type
=
$
(
type_id
+
" option:selected"
).
val
();
$
(
'.'
+
app_type
+
'-fields'
).
removeClass
(
'hidden'
);
$
(
'.'
+
type
+
'-fields'
).
removeClass
(
'hidden'
);
}
}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
({
$
(
'.select2'
).
select2
({
closeOnSelect
:
true
closeOnSelect
:
true
});
});
appTypeChange
()
initialDefaultValue
();
hiddenFields
();
setDefaultValue
();
})
})
.
on
(
'change'
,
type_id
,
function
(){
.
on
(
'change'
,
app_type_id
,
function
(){
appTypeChange
();
hiddenFields
();
setDefaultValue
();
});
});
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
apps/authentication/backends/ldap.py
View file @
b237cbb2
...
@@ -7,6 +7,8 @@ from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
...
@@ -7,6 +7,8 @@ from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from
django_auth_ldap.backend
import
_LDAPUser
,
LDAPBackend
from
django_auth_ldap.backend
import
_LDAPUser
,
LDAPBackend
from
django_auth_ldap.config
import
_LDAPConfig
,
LDAPSearch
,
LDAPSearchUnion
from
django_auth_ldap.config
import
_LDAPConfig
,
LDAPSearch
,
LDAPSearchUnion
from
users.utils
import
construct_user_email
logger
=
_LDAPConfig
.
get_logger
()
logger
=
_LDAPConfig
.
get_logger
()
...
@@ -86,13 +88,18 @@ class LDAPUser(_LDAPUser):
...
@@ -86,13 +88,18 @@ class LDAPUser(_LDAPUser):
return
user_dn
return
user_dn
def
_populate_user_from_attributes
(
self
):
def
_populate_user_from_attributes
(
self
):
super
()
.
_populate_user_from_attributes
()
for
field
,
attr
in
self
.
settings
.
USER_ATTR_MAP
.
items
():
if
not
hasattr
(
self
.
_user
,
'email'
)
or
'@'
not
in
self
.
_user
.
email
:
try
:
if
'@'
not
in
self
.
_user
.
username
:
value
=
self
.
attrs
[
attr
][
0
]
email
=
'{}@{}'
.
format
(
self
.
_user
.
username
,
settings
.
EMAIL_SUFFIX
)
except
LookupError
:
logger
.
warning
(
"{} does not have a value for the attribute {}"
.
format
(
self
.
dn
,
attr
))
else
:
else
:
email
=
self
.
_user
.
username
if
not
hasattr
(
self
.
_user
,
field
):
setattr
(
self
.
_user
,
'email'
,
email
)
continue
if
isinstance
(
getattr
(
self
.
_user
,
field
),
bool
):
value
=
value
.
lower
()
in
[
'true'
,
'1'
]
setattr
(
self
.
_user
,
field
,
value
)
email
=
getattr
(
self
.
_user
,
'email'
,
''
)
email
=
construct_user_email
(
email
,
self
.
_user
.
username
)
setattr
(
self
.
_user
,
'email'
,
email
)
apps/jumpserver/settings.py
View file @
b237cbb2
...
@@ -357,6 +357,12 @@ EMAIL_USE_SSL = False
...
@@ -357,6 +357,12 @@ EMAIL_USE_SSL = False
EMAIL_USE_TLS
=
False
EMAIL_USE_TLS
=
False
EMAIL_SUBJECT_PREFIX
=
'[JMS] '
EMAIL_SUBJECT_PREFIX
=
'[JMS] '
#Email custom content
EMAIL_CUSTOM_USER_CREATED_SUBJECT
=
''
EMAIL_CUSTOM_USER_CREATED_HONORIFIC
=
''
EMAIL_CUSTOM_USER_CREATED_BODY
=
''
EMAIL_CUSTOM_USER_CREATED_SIGNATURE
=
''
REST_FRAMEWORK
=
{
REST_FRAMEWORK
=
{
# Use Django's standard `django.contrib.auth` permissions,
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
# or allow read-only access for unauthenticated users.
...
...
apps/locale/zh/LC_MESSAGES/django.mo
View file @
b237cbb2
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
b237cbb2
...
@@ -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: 2019-05-2
1 21:09
+0800\n"
"POT-Creation-Date: 2019-05-2
4 12:02
+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"
...
@@ -33,45 +33,45 @@ msgstr "虚拟化工具"
...
@@ -33,45 +33,45 @@ msgstr "虚拟化工具"
msgid "Custom"
msgid "Custom"
msgstr "自定义"
msgstr "自定义"
#: applications/forms/remote_app.py:2
0
#: applications/forms/remote_app.py:2
1
msgid "Target URL"
msgid "Target URL"
msgstr "目标URL"
msgstr "目标URL"
#: applications/forms/remote_app.py:2
3 applications/forms/remote_app.py:52
#: applications/forms/remote_app.py:2
4 applications/forms/remote_app.py:53
#: applications/forms/remote_app.py:6
8
#: applications/forms/remote_app.py:6
9
msgid "Login username"
msgid "Login username"
msgstr "登录账号"
msgstr "登录账号"
#: applications/forms/remote_app.py:2
7 applications/forms/remote_app.py:56
#: applications/forms/remote_app.py:2
8 applications/forms/remote_app.py:57
#: applications/forms/remote_app.py:7
2
#: applications/forms/remote_app.py:7
3
msgid "Login password"
msgid "Login password"
msgstr "登录密码"
msgstr "登录密码"
#: applications/forms/remote_app.py:3
3
#: applications/forms/remote_app.py:3
4
msgid "Database IP"
msgid "Database IP"
msgstr "数据库IP"
msgstr "数据库IP"
#: applications/forms/remote_app.py:3
6
#: applications/forms/remote_app.py:3
7
msgid "Database name"
msgid "Database name"
msgstr "数据库名"
msgstr "数据库名"
#: applications/forms/remote_app.py:
39
#: applications/forms/remote_app.py:
40
msgid "Database username"
msgid "Database username"
msgstr "数据库账号"
msgstr "数据库账号"
#: applications/forms/remote_app.py:4
3
#: applications/forms/remote_app.py:4
4
msgid "Database password"
msgid "Database password"
msgstr "数据库密码"
msgstr "数据库密码"
#: applications/forms/remote_app.py:
49 applications/forms/remote_app.py:65
#: applications/forms/remote_app.py:
50 applications/forms/remote_app.py:66
msgid "Target address"
msgid "Target address"
msgstr "目标地址"
msgstr "目标地址"
#: applications/forms/remote_app.py:6
2
#: applications/forms/remote_app.py:6
3
msgid "Operating parameter"
msgid "Operating parameter"
msgstr "运行参数"
msgstr "运行参数"
#: applications/forms/remote_app.py:10
5
applications/models/remote_app.py:23
#: applications/forms/remote_app.py:10
6
applications/models/remote_app.py:23
#: applications/templates/applications/remote_app_detail.html:57
#: applications/templates/applications/remote_app_detail.html:57
#: applications/templates/applications/remote_app_list.html:22
#: applications/templates/applications/remote_app_list.html:22
#: applications/templates/applications/user_remote_app_list.html:18
#: applications/templates/applications/user_remote_app_list.html:18
...
@@ -101,12 +101,12 @@ msgstr "运行参数"
...
@@ -101,12 +101,12 @@ msgstr "运行参数"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:13
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:13
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:14
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:14
#: xpack/plugins/cloud/models.py:187
#: xpack/plugins/cloud/models.py:187
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
5
#: xpack/plugins/orgs/templates/orgs/org_list.html:16
#: xpack/plugins/orgs/templates/orgs/org_list.html:16
msgid "Asset"
msgid "Asset"
msgstr "资产"
msgstr "资产"
#: applications/forms/remote_app.py:10
8
applications/models/remote_app.py:27
#: applications/forms/remote_app.py:10
9
applications/models/remote_app.py:27
#: applications/templates/applications/remote_app_detail.html:61
#: applications/templates/applications/remote_app_detail.html:61
#: applications/templates/applications/remote_app_list.html:23
#: applications/templates/applications/remote_app_list.html:23
#: applications/templates/applications/user_remote_app_list.html:19
#: applications/templates/applications/user_remote_app_list.html:19
...
@@ -161,8 +161,8 @@ msgstr "系统用户"
...
@@ -161,8 +161,8 @@ msgstr "系统用户"
#: settings/templates/settings/_ldap_list_users_modal.html:38
#: settings/templates/settings/_ldap_list_users_modal.html:38
#: settings/templates/settings/command_storage_create.html:41
#: settings/templates/settings/command_storage_create.html:41
#: settings/templates/settings/replay_storage_create.html:44
#: settings/templates/settings/replay_storage_create.html:44
#: settings/templates/settings/terminal_setting.html:8
0
#: settings/templates/settings/terminal_setting.html:8
3
#: settings/templates/settings/terminal_setting.html:10
2
terminal/models.py:22
#: settings/templates/settings/terminal_setting.html:10
5
terminal/models.py:22
#: terminal/models.py:241 terminal/templates/terminal/terminal_detail.html:43
#: terminal/models.py:241 terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:61 users/templates/users/_select_user_modal.html:13
#: users/models/user.py:61 users/templates/users/_select_user_modal.html:13
...
@@ -177,9 +177,9 @@ msgstr "系统用户"
...
@@ -177,9 +177,9 @@ msgstr "系统用户"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12
#: xpack/plugins/cloud/models.py:49 xpack/plugins/cloud/models.py:119
#: xpack/plugins/cloud/models.py:49 xpack/plugins/cloud/models.py:119
#: xpack/plugins/cloud/templates/cloud/account_detail.html:5
0
#: xpack/plugins/cloud/templates/cloud/account_detail.html:5
2
#: xpack/plugins/cloud/templates/cloud/account_list.html:12
#: xpack/plugins/cloud/templates/cloud/account_list.html:12
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:5
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:5
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:12
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:12
#: xpack/plugins/orgs/templates/orgs/org_detail.html:52
#: xpack/plugins/orgs/templates/orgs/org_detail.html:52
#: xpack/plugins/orgs/templates/orgs/org_list.html:12
#: xpack/plugins/orgs/templates/orgs/org_list.html:12
...
@@ -224,6 +224,8 @@ msgstr "参数"
...
@@ -224,6 +224,8 @@ msgstr "参数"
msgid "Created by"
msgid "Created by"
msgstr "创建者"
msgstr "创建者"
# msgid "Created by"
# msgstr "创建者"
#: applications/models/remote_app.py:46
#: applications/models/remote_app.py:46
#: applications/templates/applications/remote_app_detail.html:73
#: applications/templates/applications/remote_app_detail.html:73
#: assets/models/asset.py:110 assets/models/cluster.py:26
#: assets/models/asset.py:110 assets/models/cluster.py:26
...
@@ -242,12 +244,14 @@ msgstr "创建者"
...
@@ -242,12 +244,14 @@ msgstr "创建者"
#: users/templates/users/user_group_detail.html:63
#: users/templates/users/user_group_detail.html:63
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:105
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:105
#: xpack/plugins/cloud/models.py:56 xpack/plugins/cloud/models.py:128
#: xpack/plugins/cloud/models.py:56 xpack/plugins/cloud/models.py:128
#: xpack/plugins/cloud/templates/cloud/account_detail.html:6
6
#: xpack/plugins/cloud/templates/cloud/account_detail.html:6
8
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:7
7
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:7
9
#: xpack/plugins/orgs/templates/orgs/org_detail.html:60
#: xpack/plugins/orgs/templates/orgs/org_detail.html:60
msgid "Date created"
msgid "Date created"
msgstr "创建日期"
msgstr "创建日期"
# msgid "Date created"
# msgstr "创建日期"
#: applications/models/remote_app.py:49
#: applications/models/remote_app.py:49
#: applications/templates/applications/remote_app_detail.html:81
#: applications/templates/applications/remote_app_detail.html:81
#: applications/templates/applications/remote_app_list.html:24
#: applications/templates/applications/remote_app_list.html:24
...
@@ -282,9 +286,9 @@ msgstr "创建日期"
...
@@ -282,9 +286,9 @@ msgstr "创建日期"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:117
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:117
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:19
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:19
#: xpack/plugins/cloud/models.py:54 xpack/plugins/cloud/models.py:125
#: xpack/plugins/cloud/models.py:54 xpack/plugins/cloud/models.py:125
#: xpack/plugins/cloud/templates/cloud/account_detail.html:7
0
#: xpack/plugins/cloud/templates/cloud/account_detail.html:7
2
#: xpack/plugins/cloud/templates/cloud/account_list.html:15
#: xpack/plugins/cloud/templates/cloud/account_list.html:15
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:
69
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:
71
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:16
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:16
#: xpack/plugins/orgs/templates/orgs/org_detail.html:64
#: xpack/plugins/orgs/templates/orgs/org_detail.html:64
#: xpack/plugins/orgs/templates/orgs/org_list.html:22
#: xpack/plugins/orgs/templates/orgs/org_list.html:22
...
@@ -315,13 +319,14 @@ msgstr "远程应用"
...
@@ -315,13 +319,14 @@ msgstr "远程应用"
#: assets/templates/assets/label_create_update.html:18
#: assets/templates/assets/label_create_update.html:18
#: perms/templates/perms/asset_permission_create_update.html:83
#: perms/templates/perms/asset_permission_create_update.html:83
#: perms/templates/perms/remote_app_permission_create_update.html:83
#: perms/templates/perms/remote_app_permission_create_update.html:83
#: settings/templates/settings/basic_setting.html:6
1
#: settings/templates/settings/basic_setting.html:6
4
#: settings/templates/settings/command_storage_create.html:79
#: settings/templates/settings/command_storage_create.html:79
#: settings/templates/settings/email_setting.html:62
#: settings/templates/settings/email_content_setting.html:54
#: settings/templates/settings/ldap_setting.html:61
#: settings/templates/settings/email_setting.html:65
#: settings/templates/settings/ldap_setting.html:64
#: settings/templates/settings/replay_storage_create.html:152
#: settings/templates/settings/replay_storage_create.html:152
#: settings/templates/settings/security_setting.html:7
0
#: settings/templates/settings/security_setting.html:7
3
#: settings/templates/settings/terminal_setting.html:
68
#: settings/templates/settings/terminal_setting.html:
71
#: terminal/templates/terminal/terminal_update.html:45
#: terminal/templates/terminal/terminal_update.html:45
#: users/templates/users/_user.html:50
#: users/templates/users/_user.html:50
#: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_bulk_update.html:23
...
@@ -353,13 +358,14 @@ msgstr "重置"
...
@@ -353,13 +358,14 @@ msgstr "重置"
#: audits/templates/audits/login_log_list.html:89
#: audits/templates/audits/login_log_list.html:89
#: perms/templates/perms/asset_permission_create_update.html:84
#: perms/templates/perms/asset_permission_create_update.html:84
#: perms/templates/perms/remote_app_permission_create_update.html:84
#: perms/templates/perms/remote_app_permission_create_update.html:84
#: settings/templates/settings/basic_setting.html:6
2
#: settings/templates/settings/basic_setting.html:6
5
#: settings/templates/settings/command_storage_create.html:80
#: settings/templates/settings/command_storage_create.html:80
#: settings/templates/settings/email_setting.html:63
#: settings/templates/settings/email_content_setting.html:55
#: settings/templates/settings/ldap_setting.html:64
#: settings/templates/settings/email_setting.html:66
#: settings/templates/settings/ldap_setting.html:67
#: settings/templates/settings/replay_storage_create.html:153
#: settings/templates/settings/replay_storage_create.html:153
#: settings/templates/settings/security_setting.html:7
1
#: settings/templates/settings/security_setting.html:7
4
#: settings/templates/settings/terminal_setting.html:7
0
#: settings/templates/settings/terminal_setting.html:7
3
#: terminal/templates/terminal/command_list.html:103
#: terminal/templates/terminal/command_list.html:103
#: terminal/templates/terminal/session_list.html:126
#: terminal/templates/terminal/session_list.html:126
#: terminal/templates/terminal/terminal_update.html:46
#: terminal/templates/terminal/terminal_update.html:46
...
@@ -437,11 +443,11 @@ msgstr "详情"
...
@@ -437,11 +443,11 @@ msgstr "详情"
#: users/templates/users/user_profile.html:187
#: users/templates/users/user_profile.html:187
#: users/templates/users/user_profile.html:196
#: users/templates/users/user_profile.html:196
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:29
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:29
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
5
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
4
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
3
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
5
#: xpack/plugins/cloud/templates/cloud/account_list.html:3
9
#: xpack/plugins/cloud/templates/cloud/account_list.html:3
8
#: xpack/plugins/orgs/templates/orgs/org_detail.html:25
#: xpack/plugins/orgs/templates/orgs/org_detail.html:25
#: xpack/plugins/orgs/templates/orgs/org_list.html:8
7
#: xpack/plugins/orgs/templates/orgs/org_list.html:8
5
msgid "Update"
msgid "Update"
msgstr "更新"
msgstr "更新"
...
@@ -466,8 +472,8 @@ msgstr "更新"
...
@@ -466,8 +472,8 @@ msgstr "更新"
#: perms/templates/perms/asset_permission_list.html:182
#: perms/templates/perms/asset_permission_list.html:182
#: perms/templates/perms/remote_app_permission_detail.html:34
#: perms/templates/perms/remote_app_permission_detail.html:34
#: perms/templates/perms/remote_app_permission_list.html:60
#: perms/templates/perms/remote_app_permission_list.html:60
#: settings/templates/settings/terminal_setting.html:9
0
#: settings/templates/settings/terminal_setting.html:9
3
#: settings/templates/settings/terminal_setting.html:11
2
#: settings/templates/settings/terminal_setting.html:11
5
#: terminal/templates/terminal/terminal_list.html:74
#: terminal/templates/terminal/terminal_list.html:74
#: users/templates/users/user_detail.html:30
#: users/templates/users/user_detail.html:30
#: users/templates/users/user_group_detail.html:32
#: users/templates/users/user_group_detail.html:32
...
@@ -475,13 +481,13 @@ msgstr "更新"
...
@@ -475,13 +481,13 @@ msgstr "更新"
#: users/templates/users/user_list.html:104
#: users/templates/users/user_list.html:104
#: users/templates/users/user_list.html:108
#: users/templates/users/user_list.html:108
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:33
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:33
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
7
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
6
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
7
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
9
#: xpack/plugins/cloud/templates/cloud/account_list.html:4
1
#: xpack/plugins/cloud/templates/cloud/account_list.html:4
0
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:3
0
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:3
2
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:5
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:5
4
#: xpack/plugins/orgs/templates/orgs/org_detail.html:29
#: xpack/plugins/orgs/templates/orgs/org_detail.html:29
#: xpack/plugins/orgs/templates/orgs/org_list.html:8
9
#: xpack/plugins/orgs/templates/orgs/org_list.html:8
7
msgid "Delete"
msgid "Delete"
msgstr "删除"
msgstr "删除"
...
@@ -528,8 +534,8 @@ msgstr "创建远程应用"
...
@@ -528,8 +534,8 @@ msgstr "创建远程应用"
#: perms/templates/perms/asset_permission_list.html:60
#: perms/templates/perms/asset_permission_list.html:60
#: perms/templates/perms/asset_permission_list.html:134
#: perms/templates/perms/asset_permission_list.html:134
#: perms/templates/perms/remote_app_permission_list.html:19
#: perms/templates/perms/remote_app_permission_list.html:19
#: settings/templates/settings/terminal_setting.html:8
2
#: settings/templates/settings/terminal_setting.html:8
5
#: settings/templates/settings/terminal_setting.html:10
4
#: settings/templates/settings/terminal_setting.html:10
7
#: terminal/templates/terminal/session_list.html:81
#: terminal/templates/terminal/session_list.html:81
#: terminal/templates/terminal/terminal_list.html:36
#: terminal/templates/terminal/terminal_list.html:36
#: users/templates/users/user_group_list.html:38
#: users/templates/users/user_group_list.html:38
...
@@ -618,7 +624,7 @@ msgstr "节点管理"
...
@@ -618,7 +624,7 @@ msgstr "节点管理"
#: assets/models/cluster.py:19 assets/models/user.py:91
#: assets/models/cluster.py:19 assets/models/user.py:91
#: assets/templates/assets/asset_detail.html:80 templates/_nav.html:24
#: assets/templates/assets/asset_detail.html:80 templates/_nav.html:24
#: xpack/plugins/cloud/models.py:124
#: xpack/plugins/cloud/models.py:124
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:6
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:6
7
#: xpack/plugins/orgs/templates/orgs/org_list.html:18
#: xpack/plugins/orgs/templates/orgs/org_list.html:18
msgid "Admin user"
msgid "Admin user"
msgstr "管理用户"
msgstr "管理用户"
...
@@ -655,8 +661,8 @@ msgstr "网域"
...
@@ -655,8 +661,8 @@ msgstr "网域"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:55
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:55
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:15
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:15
#: xpack/plugins/cloud/models.py:123
#: xpack/plugins/cloud/models.py:123
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:6
1
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:6
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
4
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
6
msgid "Node"
msgid "Node"
msgstr "节点"
msgstr "节点"
...
@@ -1069,8 +1075,8 @@ msgstr "过滤器"
...
@@ -1069,8 +1075,8 @@ msgstr "过滤器"
#: perms/templates/perms/remote_app_permission_remote_app.html:54
#: perms/templates/perms/remote_app_permission_remote_app.html:54
#: settings/templates/settings/command_storage_create.html:31
#: settings/templates/settings/command_storage_create.html:31
#: settings/templates/settings/replay_storage_create.html:31
#: settings/templates/settings/replay_storage_create.html:31
#: settings/templates/settings/terminal_setting.html:8
1
#: settings/templates/settings/terminal_setting.html:8
4
#: settings/templates/settings/terminal_setting.html:10
3
#: settings/templates/settings/terminal_setting.html:10
6
msgid "Type"
msgid "Type"
msgstr "类型"
msgstr "类型"
...
@@ -1382,7 +1388,7 @@ msgstr "需要二次认证来查看账号信息"
...
@@ -1382,7 +1388,7 @@ msgstr "需要二次认证来查看账号信息"
#: assets/templates/assets/system_user_asset.html:112
#: assets/templates/assets/system_user_asset.html:112
#: assets/templates/assets/system_user_detail.html:182
#: assets/templates/assets/system_user_detail.html:182
#: assets/templates/assets/system_user_list.html:168
#: assets/templates/assets/system_user_list.html:168
#: settings/templates/settings/terminal_setting.html:16
5
#: settings/templates/settings/terminal_setting.html:16
8
#: templates/_modal.html:23 terminal/templates/terminal/session_detail.html:108
#: templates/_modal.html:23 terminal/templates/terminal/session_detail.html:108
#: users/templates/users/user_detail.html:388
#: users/templates/users/user_detail.html:388
#: users/templates/users/user_detail.html:414
#: users/templates/users/user_detail.html:414
...
@@ -1409,7 +1415,7 @@ msgstr "获取认证信息错误"
...
@@ -1409,7 +1415,7 @@ msgstr "获取认证信息错误"
#: assets/templates/assets/_asset_user_view_auth_modal.html:139
#: assets/templates/assets/_asset_user_view_auth_modal.html:139
#: assets/templates/assets/_user_asset_detail_modal.html:23
#: assets/templates/assets/_user_asset_detail_modal.html:23
#: settings/templates/settings/_ldap_list_users_modal.html:9
6
#: settings/templates/settings/_ldap_list_users_modal.html:9
9
#: templates/_modal.html:22
#: templates/_modal.html:22
msgid "Close"
msgid "Close"
msgstr "关闭"
msgstr "关闭"
...
@@ -1578,7 +1584,7 @@ msgstr "导出"
...
@@ -1578,7 +1584,7 @@ msgstr "导出"
#: assets/templates/assets/admin_user_list.html:24
#: assets/templates/assets/admin_user_list.html:24
#: assets/templates/assets/asset_list.html:81
#: assets/templates/assets/asset_list.html:81
#: assets/templates/assets/system_user_list.html:28
#: assets/templates/assets/system_user_list.html:28
#: settings/templates/settings/_ldap_list_users_modal.html:
97
#: settings/templates/settings/_ldap_list_users_modal.html:
100
#: users/templates/users/user_group_list.html:15
#: users/templates/users/user_group_list.html:15
#: users/templates/users/user_list.html:15
#: users/templates/users/user_list.html:15
#: xpack/plugins/license/templates/license/license_detail.html:110
#: xpack/plugins/license/templates/license/license_detail.html:110
...
@@ -1799,7 +1805,7 @@ msgstr "删除选择资产"
...
@@ -1799,7 +1805,7 @@ msgstr "删除选择资产"
#: assets/templates/assets/asset_list.html:698
#: assets/templates/assets/asset_list.html:698
#: assets/templates/assets/system_user_list.html:166
#: assets/templates/assets/system_user_list.html:166
#: settings/templates/settings/terminal_setting.html:16
3
#: settings/templates/settings/terminal_setting.html:16
6
#: users/templates/users/user_detail.html:386
#: users/templates/users/user_detail.html:386
#: users/templates/users/user_detail.html:412
#: users/templates/users/user_detail.html:412
#: users/templates/users/user_detail.html:480
#: users/templates/users/user_detail.html:480
...
@@ -1903,8 +1909,8 @@ msgstr "创建网关"
...
@@ -1903,8 +1909,8 @@ msgstr "创建网关"
#: assets/templates/assets/domain_gateway_list.html:99
#: assets/templates/assets/domain_gateway_list.html:99
#: assets/templates/assets/domain_gateway_list.html:101
#: assets/templates/assets/domain_gateway_list.html:101
#: settings/templates/settings/email_setting.html:6
1
#: settings/templates/settings/email_setting.html:6
4
#: settings/templates/settings/ldap_setting.html:6
2
#: settings/templates/settings/ldap_setting.html:6
5
msgid "Test connection"
msgid "Test connection"
msgstr "测试连接"
msgstr "测试连接"
...
@@ -2227,7 +2233,7 @@ msgstr "原因"
...
@@ -2227,7 +2233,7 @@ msgstr "原因"
#: audits/models.py:101 audits/templates/audits/login_log_list.html:58
#: audits/models.py:101 audits/templates/audits/login_log_list.html:58
#: xpack/plugins/cloud/models.py:171 xpack/plugins/cloud/models.py:188
#: xpack/plugins/cloud/models.py:171 xpack/plugins/cloud/models.py:188
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:70
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:70
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
7
msgid "Status"
msgid "Status"
msgstr "状态"
msgstr "状态"
...
@@ -2267,7 +2273,7 @@ msgstr "选择用户"
...
@@ -2267,7 +2273,7 @@ msgstr "选择用户"
#: terminal/templates/terminal/command_list.html:60
#: terminal/templates/terminal/command_list.html:60
#: terminal/templates/terminal/session_list.html:61
#: terminal/templates/terminal/session_list.html:61
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:52
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:52
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:
48
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:
50
msgid "Search"
msgid "Search"
msgstr "搜索"
msgstr "搜索"
...
@@ -2277,7 +2283,7 @@ msgstr "搜索"
...
@@ -2277,7 +2283,7 @@ msgstr "搜索"
#: ops/templates/ops/task_detail.html:56
#: ops/templates/ops/task_detail.html:56
#: terminal/templates/terminal/session_list.html:70
#: terminal/templates/terminal/session_list.html:70
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:64
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:64
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
0
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
2
msgid "ID"
msgid "ID"
msgstr "ID"
msgstr "ID"
...
@@ -2679,7 +2685,7 @@ msgid "Become"
...
@@ -2679,7 +2685,7 @@ msgid "Become"
msgstr "Become"
msgstr "Become"
#: ops/models/adhoc.py:166 users/templates/users/user_group_detail.html:59
#: ops/models/adhoc.py:166 users/templates/users/user_group_detail.html:59
#: xpack/plugins/cloud/templates/cloud/account_detail.html:6
2
#: xpack/plugins/cloud/templates/cloud/account_detail.html:6
4
#: xpack/plugins/orgs/templates/orgs/org_detail.html:56
#: xpack/plugins/orgs/templates/orgs/org_detail.html:56
msgid "Create by"
msgid "Create by"
msgstr "创建者"
msgstr "创建者"
...
@@ -2925,8 +2931,8 @@ msgstr "版本"
...
@@ -2925,8 +2931,8 @@ msgstr "版本"
#: ops/templates/ops/task_list.html:63
#: ops/templates/ops/task_list.html:63
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:137
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:137
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
3
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:5
2
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:5
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:5
2
msgid "Run"
msgid "Run"
msgstr "执行"
msgstr "执行"
...
@@ -3050,8 +3056,8 @@ msgstr "添加资产"
...
@@ -3050,8 +3056,8 @@ msgstr "添加资产"
#: perms/templates/perms/remote_app_permission_remote_app.html:96
#: perms/templates/perms/remote_app_permission_remote_app.html:96
#: perms/templates/perms/remote_app_permission_user.html:96
#: perms/templates/perms/remote_app_permission_user.html:96
#: perms/templates/perms/remote_app_permission_user.html:124
#: perms/templates/perms/remote_app_permission_user.html:124
#: settings/templates/settings/terminal_setting.html:9
5
#: settings/templates/settings/terminal_setting.html:9
8
#: settings/templates/settings/terminal_setting.html:1
17
#: settings/templates/settings/terminal_setting.html:1
20
#: users/templates/users/user_group_detail.html:95
#: users/templates/users/user_group_detail.html:95
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:93
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:93
#: xpack/plugins/orgs/templates/orgs/org_detail.html:93
#: xpack/plugins/orgs/templates/orgs/org_detail.html:93
...
@@ -3111,7 +3117,7 @@ msgstr "创建授权规则"
...
@@ -3111,7 +3117,7 @@ msgstr "创建授权规则"
#: perms/templates/perms/asset_permission_list.html:73
#: perms/templates/perms/asset_permission_list.html:73
#: perms/templates/perms/remote_app_permission_list.html:18
#: perms/templates/perms/remote_app_permission_list.html:18
#: users/templates/users/user_list.html:40 xpack/plugins/cloud/models.py:53
#: users/templates/users/user_list.html:40 xpack/plugins/cloud/models.py:53
#: xpack/plugins/cloud/templates/cloud/account_detail.html:
58
#: xpack/plugins/cloud/templates/cloud/account_detail.html:
60
#: xpack/plugins/cloud/templates/cloud/account_list.html:14
#: xpack/plugins/cloud/templates/cloud/account_list.html:14
msgid "Validity"
msgid "Validity"
msgstr "有效"
msgstr "有效"
...
@@ -3246,7 +3252,7 @@ msgid "Create succeed"
...
@@ -3246,7 +3252,7 @@ msgid "Create succeed"
msgstr "创建成功"
msgstr "创建成功"
#: settings/api.py:166 settings/api.py:204
#: settings/api.py:166 settings/api.py:204
#: settings/templates/settings/terminal_setting.html:15
1
#: settings/templates/settings/terminal_setting.html:15
4
msgid "Delete succeed"
msgid "Delete succeed"
msgstr "删除成功"
msgstr "删除成功"
...
@@ -3484,6 +3490,40 @@ msgid ""
...
@@ -3484,6 +3490,40 @@ msgid ""
"characters"
"characters"
msgstr "开启后,用户密码修改、重置必须包含特殊字符"
msgstr "开启后,用户密码修改、重置必须包含特殊字符"
#: settings/forms.py:248
msgid "Create user email subject"
msgstr "创建用户邮件的主题"
#: settings/forms.py:249
msgid ""
"Tips: When creating a user, send the subject of the email (eg:Create account "
"successfully)"
msgstr "提示: 创建用户时,发送设置密码邮件的主题 (例如: 创建用户成功)"
#: settings/forms.py:253
msgid "Create user honorific"
msgstr "创建用户邮件的敬语"
#: settings/forms.py:254
msgid "Tips: When creating a user, send the honorific of the email (eg:Hello)"
msgstr "提示: 创建用户时,发送设置密码邮件的敬语 (例如: 您好)"
#: settings/forms.py:259
msgid "Create user email content"
msgstr "创建用户邮件的内容"
#: settings/forms.py:260
msgid "Tips:When creating a user, send the content of the email"
msgstr "提示: 创建用户时,发送设置密码邮件的内容"
#: settings/forms.py:263
msgid "Signature"
msgstr "署名"
#: settings/forms.py:264
msgid "Tips: Email signature (eg:jumpserver)"
msgstr "提示: 邮件的署名 (例如: jumpserver)"
#: settings/models.py:128 users/templates/users/reset_password.html:68
#: settings/models.py:128 users/templates/users/reset_password.html:68
#: users/templates/users/user_profile.html:20
#: users/templates/users/user_profile.html:20
msgid "Setting"
msgid "Setting"
...
@@ -3508,15 +3548,17 @@ msgid "Existing"
...
@@ -3508,15 +3548,17 @@ msgid "Existing"
msgstr "已存在"
msgstr "已存在"
#: settings/templates/settings/basic_setting.html:15
#: settings/templates/settings/basic_setting.html:15
#: settings/templates/settings/email_content_setting.html:15
#: settings/templates/settings/email_setting.html:15
#: settings/templates/settings/email_setting.html:15
#: settings/templates/settings/ldap_setting.html:15
#: settings/templates/settings/ldap_setting.html:15
#: settings/templates/settings/security_setting.html:15
#: settings/templates/settings/security_setting.html:15
#: settings/templates/settings/terminal_setting.html:16
#: settings/templates/settings/terminal_setting.html:16
#: settings/templates/settings/terminal_setting.html:4
6
settings/views.py:19
#: settings/templates/settings/terminal_setting.html:4
9
settings/views.py:19
msgid "Basic setting"
msgid "Basic setting"
msgstr "基本设置"
msgstr "基本设置"
#: settings/templates/settings/basic_setting.html:18
#: settings/templates/settings/basic_setting.html:18
#: settings/templates/settings/email_content_setting.html:18
#: settings/templates/settings/email_setting.html:18
#: settings/templates/settings/email_setting.html:18
#: settings/templates/settings/ldap_setting.html:18
#: settings/templates/settings/ldap_setting.html:18
#: settings/templates/settings/security_setting.html:18
#: settings/templates/settings/security_setting.html:18
...
@@ -3525,27 +3567,39 @@ msgid "Email setting"
...
@@ -3525,27 +3567,39 @@ msgid "Email setting"
msgstr "邮件设置"
msgstr "邮件设置"
#: settings/templates/settings/basic_setting.html:21
#: settings/templates/settings/basic_setting.html:21
#: settings/templates/settings/email_content_setting.html:21
#: settings/templates/settings/email_setting.html:21
#: settings/templates/settings/email_setting.html:21
#: settings/templates/settings/ldap_setting.html:21
#: settings/templates/settings/ldap_setting.html:21
#: settings/templates/settings/security_setting.html:21
#: settings/templates/settings/security_setting.html:21
#: settings/templates/settings/terminal_setting.html:2
4 settings/views.py:71
#: settings/templates/settings/terminal_setting.html:2
3 settings/views.py:178
msgid "
LDAP
setting"
msgid "
Email content
setting"
msgstr "
LDAP
设置"
msgstr "
邮件内容
设置"
#: settings/templates/settings/basic_setting.html:24
#: settings/templates/settings/basic_setting.html:24
#: settings/templates/settings/email_content_setting.html:24
#: settings/templates/settings/email_setting.html:24
#: settings/templates/settings/email_setting.html:24
#: settings/templates/settings/ldap_setting.html:24
#: settings/templates/settings/ldap_setting.html:24
#: settings/templates/settings/security_setting.html:24
#: settings/templates/settings/security_setting.html:24
#: settings/templates/settings/terminal_setting.html:2
8 settings/views.py:100
#: settings/templates/settings/terminal_setting.html:2
7 settings/views.py:71
msgid "
Terminal
setting"
msgid "
LDAP
setting"
msgstr "
终端
设置"
msgstr "
LDAP
设置"
#: settings/templates/settings/basic_setting.html:27
#: settings/templates/settings/basic_setting.html:27
#: settings/templates/settings/email_content_setting.html:27
#: settings/templates/settings/email_setting.html:27
#: settings/templates/settings/email_setting.html:27
#: settings/templates/settings/ldap_setting.html:27
#: settings/templates/settings/ldap_setting.html:27
#: settings/templates/settings/security_setting.html:27
#: settings/templates/settings/security_setting.html:27
#: settings/templates/settings/security_setting.html:42
#: settings/templates/settings/terminal_setting.html:31 settings/views.py:100
#: settings/templates/settings/terminal_setting.html:31 settings/views.py:152
msgid "Terminal setting"
msgstr "终端设置"
#: settings/templates/settings/basic_setting.html:30
#: settings/templates/settings/email_content_setting.html:30
#: settings/templates/settings/email_setting.html:30
#: settings/templates/settings/ldap_setting.html:30
#: settings/templates/settings/security_setting.html:30
#: settings/templates/settings/security_setting.html:45
#: settings/templates/settings/terminal_setting.html:34 settings/views.py:152
msgid "Security setting"
msgid "Security setting"
msgstr "安全设置"
msgstr "安全设置"
...
@@ -3561,11 +3615,15 @@ msgstr "索引"
...
@@ -3561,11 +3615,15 @@ msgstr "索引"
msgid "Doc type"
msgid "Doc type"
msgstr "文档类型"
msgstr "文档类型"
#: settings/templates/settings/ldap_setting.html:65
#: settings/templates/settings/email_content_setting.html:45
msgid "Create User setting"
msgstr "创建用户设置"
#: settings/templates/settings/ldap_setting.html:68
msgid "Bulk import"
msgid "Bulk import"
msgstr "一键导入"
msgstr "一键导入"
#: settings/templates/settings/ldap_setting.html:11
6
#: settings/templates/settings/ldap_setting.html:11
9
msgid ""
msgid ""
"User is not currently selected, please check the user you want to import"
"User is not currently selected, please check the user you want to import"
msgstr "当前无勾选用户,请勾选你想要导入的用户"
msgstr "当前无勾选用户,请勾选你想要导入的用户"
...
@@ -3627,8 +3685,8 @@ msgstr "端点后缀"
...
@@ -3627,8 +3685,8 @@ msgstr "端点后缀"
#: settings/templates/settings/replay_storage_create.html:136
#: settings/templates/settings/replay_storage_create.html:136
#: xpack/plugins/cloud/models.py:186
#: xpack/plugins/cloud/models.py:186
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:8
1
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:8
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
2
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
4
msgid "Region"
msgid "Region"
msgstr "地域"
msgstr "地域"
...
@@ -3652,48 +3710,48 @@ msgstr "提交中"
...
@@ -3652,48 +3710,48 @@ msgstr "提交中"
msgid "Endpoint need contain protocol, ex: http"
msgid "Endpoint need contain protocol, ex: http"
msgstr "端点需要包含协议,如 http"
msgstr "端点需要包含协议,如 http"
#: settings/templates/settings/security_setting.html:4
6
#: settings/templates/settings/security_setting.html:4
9
msgid "Password check rule"
msgid "Password check rule"
msgstr "密码校验规则"
msgstr "密码校验规则"
#: settings/templates/settings/terminal_setting.html:7
6
terminal/forms.py:27
#: settings/templates/settings/terminal_setting.html:7
9
terminal/forms.py:27
#: terminal/models.py:26
#: terminal/models.py:26
msgid "Command storage"
msgid "Command storage"
msgstr "命令存储"
msgstr "命令存储"
#: settings/templates/settings/terminal_setting.html:
98
terminal/forms.py:32
#: settings/templates/settings/terminal_setting.html:
101
terminal/forms.py:32
#: terminal/models.py:27
#: terminal/models.py:27
msgid "Replay storage"
msgid "Replay storage"
msgstr "录像存储"
msgstr "录像存储"
#: settings/templates/settings/terminal_setting.html:15
4
#: settings/templates/settings/terminal_setting.html:15
7
msgid "Delete failed"
msgid "Delete failed"
msgstr "删除失败"
msgstr "删除失败"
#: settings/templates/settings/terminal_setting.html:1
59
#: settings/templates/settings/terminal_setting.html:1
62
msgid "Are you sure about deleting it?"
msgid "Are you sure about deleting it?"
msgstr "您确定删除吗?"
msgstr "您确定删除吗?"
#: settings/utils.py:
69
#: settings/utils.py:
71
msgid "User does not exist"
msgid "User does not exist"
msgstr "用户不存在"
msgstr "用户不存在"
#: settings/utils.py:7
2
#: settings/utils.py:7
4
msgid "The user source is not LDAP"
msgid "The user source is not LDAP"
msgstr "用户来源不是LDAP"
msgstr "用户来源不是LDAP"
#: settings/utils.py:1
46
#: settings/utils.py:1
55
msgid "Search no entry matched in ou {}"
msgid "Search no entry matched in ou {}"
msgstr "在ou:{}中没有匹配条目"
msgstr "在ou:{}中没有匹配条目"
#: settings/views.py:18 settings/views.py:44 settings/views.py:70
#: settings/views.py:18 settings/views.py:44 settings/views.py:70
#: settings/views.py:99 settings/views.py:126 settings/views.py:138
#: settings/views.py:99 settings/views.py:126 settings/views.py:138
#: settings/views.py:151 templates/_nav.html:118
#: settings/views.py:151
settings/views.py:177
templates/_nav.html:118
msgid "Settings"
msgid "Settings"
msgstr "系统设置"
msgstr "系统设置"
#: settings/views.py:29 settings/views.py:55 settings/views.py:81
#: settings/views.py:29 settings/views.py:55 settings/views.py:81
#: settings/views.py:112 settings/views.py:162
#: settings/views.py:112 settings/views.py:162
settings/views.py:188
msgid "Update setting successfully"
msgid "Update setting successfully"
msgstr "更新设置成功"
msgstr "更新设置成功"
...
@@ -4464,7 +4522,7 @@ msgstr "安全令牌验证"
...
@@ -4464,7 +4522,7 @@ msgstr "安全令牌验证"
#: users/templates/users/_base_otp.html:44 users/templates/users/_user.html:13
#: users/templates/users/_base_otp.html:44 users/templates/users/_user.html:13
#: users/templates/users/user_profile_update.html:51
#: users/templates/users/user_profile_update.html:51
#: xpack/plugins/cloud/models.py:120
#: xpack/plugins/cloud/models.py:120
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:5
7
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:5
9
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:13
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:13
msgid "Account"
msgid "Account"
msgstr "账户"
msgstr "账户"
...
@@ -4572,7 +4630,7 @@ msgid "Always young, always with tears in my eyes. Stay foolish Stay hungry"
...
@@ -4572,7 +4630,7 @@ msgid "Always young, always with tears in my eyes. Stay foolish Stay hungry"
msgstr "永远年轻,永远热泪盈眶 stay foolish stay hungry"
msgstr "永远年轻,永远热泪盈眶 stay foolish stay hungry"
#: users/templates/users/reset_password.html:46
#: users/templates/users/reset_password.html:46
#: users/templates/users/user_detail.html:373 users/utils.py:
77
#: users/templates/users/user_detail.html:373 users/utils.py:
98
msgid "Reset password"
msgid "Reset password"
msgstr "重置密码"
msgstr "重置密码"
...
@@ -4893,55 +4951,60 @@ msgid ""
...
@@ -4893,55 +4951,60 @@ msgid ""
msgstr "新的公钥已设置成功,请下载对应的私钥"
msgstr "新的公钥已设置成功,请下载对应的私钥"
#: users/utils.py:38
#: users/utils.py:38
msgid "Create account successfully"
msgstr "创建账户成功"
#: users/utils.py:40
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
" Hello %(name)s:\n"
" <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/"
" </br>\n"
"bootstrap/3.2.0/css/bootstrap.min.css\">\n"
" Your account has been created successfully\n"
" <p style=\"text-indent:2em;\">\n"
" </br>\n"
" <span>\n"
" Username: %(username)s\n"
" Username: %(username)s.\n"
" </br>\n"
" </span>\n"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">click "
" <span>\n"
"here to set your password</a>\n"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s"
" </br>\n"
"\">click here to set your password</a>\n"
" This link is valid for 1 hour. After it expires, <a href="
" </span> \n"
" <span>\n"
" This link is valid for 1 hour. After it expires, <a href="
"\"%(forget_password_url)s?email=%(email)s\">request new one</a>\n"
"\"%(forget_password_url)s?email=%(email)s\">request new one</a>\n"
"\n"
" </span> \n"
" </br>\n"
" <span>\n"
" ---\n"
" <a href=\"%(login_url)s\">Login direct</a>\n"
"\n"
" </span>\n"
" </br>\n"
" </p>\n"
" <a href=\"%(login_url)s\">Login direct</a>\n"
" "
"\n"
" </br>\n"
" "
msgstr ""
msgstr ""
"\n"
"\n"
" 你好 %(name)s:\n"
" <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/"
" </br>\n"
"bootstrap/3.2.0/css/bootstrap.min.css\">\n"
" 恭喜您,您的账号已经创建成功 </br>\n"
" <p style=\"text-indent:2em;\">\n"
" 用户名: %(username)s\n"
" <span>\n"
" </br>\n"
" 用户名: %(username)s.\n"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">请点击这"
" </span>\n"
"里设置密码</a> </br>\n"
" <span>\n"
" 这个链接有效期1小时, 超过时间您可以 <a href=\"%(forget_password_url)s?"
" <a href=\"%(rest_password_url)s?token=%(rest_password_token)s\">"
"email=%(email)s\">重新申请</a>\n"
"请点击这里设置密码</a>\n"
"\n"
" </span> \n"
" </br>\n"
" <span>\n"
" ---\n"
" 这个链接有效期1小时, 超过时间您可以 <a href="
"\n"
"\"%(forget_password_url)s?email=%(email)s\">重新申请</a>\n"
" </br>\n"
" </span> \n"
" <a href=\"%(login_url)s\">Login direct</a>\n"
" <span>\n"
"\n"
" <a href=\"%(login_url)s\">---登录页面</a>\n"
" </br>\n"
" </span>\n"
" </p>\n"
" "
" "
#: users/utils.py:79
#: users/utils.py:73
msgid "Create account successfully"
msgstr "创建账户成功"
#: users/utils.py:77
#, python-format
msgid "Hello %(name)s"
msgstr "您好 %(name)s"
#: users/utils.py:100
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
...
@@ -4985,11 +5048,11 @@ msgstr ""
...
@@ -4985,11 +5048,11 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:1
10
#: users/utils.py:1
31
msgid "Security notice"
msgid "Security notice"
msgstr "安全通知"
msgstr "安全通知"
#: users/utils.py:1
12
#: users/utils.py:1
33
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
...
@@ -5038,11 +5101,11 @@ msgstr ""
...
@@ -5038,11 +5101,11 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:1
48
#: users/utils.py:1
69
msgid "SSH Key Reset"
msgid "SSH Key Reset"
msgstr "重置ssh密钥"
msgstr "重置ssh密钥"
#: users/utils.py:1
50
#: users/utils.py:1
71
#, python-format
#, python-format
msgid ""
msgid ""
"\n"
"\n"
...
@@ -5067,15 +5130,15 @@ msgstr ""
...
@@ -5067,15 +5130,15 @@ msgstr ""
" </br>\n"
" </br>\n"
" "
" "
#: users/utils.py:
183
#: users/utils.py:
204
msgid "User not exist"
msgid "User not exist"
msgstr "用户不存在"
msgstr "用户不存在"
#: users/utils.py:
185
#: users/utils.py:
206
msgid "Disabled or expired"
msgid "Disabled or expired"
msgstr "禁用或失效"
msgstr "禁用或失效"
#: users/utils.py:
198
#: users/utils.py:
219
msgid "Password or SSH public key invalid"
msgid "Password or SSH public key invalid"
msgstr "密码或密钥不合法"
msgstr "密码或密钥不合法"
...
@@ -5341,7 +5404,7 @@ msgid "Run plan manually"
...
@@ -5341,7 +5404,7 @@ msgid "Run plan manually"
msgstr "手动执行计划"
msgstr "手动执行计划"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:179
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:179
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:10
2
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:10
1
msgid "Execute failed"
msgid "Execute failed"
msgstr "执行失败"
msgstr "执行失败"
...
@@ -5427,7 +5490,7 @@ msgid "Unavailable"
...
@@ -5427,7 +5490,7 @@ msgid "Unavailable"
msgstr "无效"
msgstr "无效"
#: xpack/plugins/cloud/models.py:50
#: xpack/plugins/cloud/models.py:50
#: xpack/plugins/cloud/templates/cloud/account_detail.html:5
4
#: xpack/plugins/cloud/templates/cloud/account_detail.html:5
6
#: xpack/plugins/cloud/templates/cloud/account_list.html:13
#: xpack/plugins/cloud/templates/cloud/account_list.html:13
msgid "Provider"
msgid "Provider"
msgstr "云服务商"
msgstr "云服务商"
...
@@ -5453,7 +5516,7 @@ msgid "Instances"
...
@@ -5453,7 +5516,7 @@ msgid "Instances"
msgstr "实例"
msgstr "实例"
#: xpack/plugins/cloud/models.py:126
#: xpack/plugins/cloud/models.py:126
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:7
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:7
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:17
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:17
msgid "Date last sync"
msgid "Date last sync"
msgstr "最后同步日期"
msgstr "最后同步日期"
...
@@ -5472,7 +5535,7 @@ msgstr ""
...
@@ -5472,7 +5535,7 @@ msgstr ""
#: xpack/plugins/cloud/models.py:173 xpack/plugins/cloud/models.py:189
#: xpack/plugins/cloud/models.py:173 xpack/plugins/cloud/models.py:189
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:71
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:71
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
6
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
8
msgid "Date sync"
msgid "Date sync"
msgstr "同步日期"
msgstr "同步日期"
...
@@ -5489,8 +5552,8 @@ msgid "Sync instance task history"
...
@@ -5489,8 +5552,8 @@ msgid "Sync instance task history"
msgstr "同步实例任务历史"
msgstr "同步实例任务历史"
#: xpack/plugins/cloud/models.py:185
#: xpack/plugins/cloud/models.py:185
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:
89
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:
91
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
1
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:6
3
msgid "Instance"
msgid "Instance"
msgstr "实例"
msgstr "实例"
...
@@ -5510,7 +5573,7 @@ msgstr "AWS (国际)"
...
@@ -5510,7 +5573,7 @@ msgstr "AWS (国际)"
msgid "Qcloud"
msgid "Qcloud"
msgstr "腾讯云"
msgstr "腾讯云"
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
0
#: xpack/plugins/cloud/templates/cloud/account_detail.html:2
2
#: xpack/plugins/cloud/views.py:72
#: xpack/plugins/cloud/views.py:72
msgid "Account detail"
msgid "Account detail"
msgstr "账户详情"
msgstr "账户详情"
...
@@ -5528,23 +5591,23 @@ msgstr "加载中..."
...
@@ -5528,23 +5591,23 @@ msgstr "加载中..."
msgid "Load failed"
msgid "Load failed"
msgstr "加载失败"
msgstr "加载失败"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
0
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
2
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:25
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:25
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
1
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
3
#: xpack/plugins/cloud/views.py:122
#: xpack/plugins/cloud/views.py:122
msgid "Sync task detail"
msgid "Sync task detail"
msgstr "同步任务详情"
msgstr "同步任务详情"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
5
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:28
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:28
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
4
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
6
#: xpack/plugins/cloud/views.py:137
#: xpack/plugins/cloud/views.py:137
msgid "Sync task history"
msgid "Sync task history"
msgstr "同步历史列表"
msgstr "同步历史列表"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
6
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:2
8
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:31
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:31
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
7
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_instance.html:2
9
#: xpack/plugins/cloud/views.py:188
#: xpack/plugins/cloud/views.py:188
msgid "Sync instance list"
msgid "Sync instance list"
msgstr "同步实例列表"
msgstr "同步实例列表"
...
@@ -5577,7 +5640,7 @@ msgstr "执行次数"
...
@@ -5577,7 +5640,7 @@ msgstr "执行次数"
msgid "Instance count"
msgid "Instance count"
msgstr "实例个数"
msgstr "实例个数"
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:9
3
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_list.html:9
2
msgid "Sync success"
msgid "Sync success"
msgstr "同步成功"
msgstr "同步成功"
...
@@ -5661,7 +5724,6 @@ msgid "This will restore default Settings of the interface !!!"
...
@@ -5661,7 +5724,6 @@ msgid "This will restore default Settings of the interface !!!"
msgstr "您确定要恢复默认初始化吗?"
msgstr "您确定要恢复默认初始化吗?"
#: xpack/plugins/interface/templates/interface/interface.html:107
#: xpack/plugins/interface/templates/interface/interface.html:107
#: xpack/plugins/interface/views.py:53
msgid "Restore default successfully."
msgid "Restore default successfully."
msgstr "恢复默认成功!"
msgstr "恢复默认成功!"
...
@@ -5674,9 +5736,13 @@ msgid "Interface"
...
@@ -5674,9 +5736,13 @@ msgid "Interface"
msgstr "界面"
msgstr "界面"
#: xpack/plugins/interface/views.py:49
#: xpack/plugins/interface/views.py:49
msgid "It is already in the default setting state
!
"
msgid "It is already in the default setting state
!
"
msgstr "当前已经是初始化状态!"
msgstr "当前已经是初始化状态!"
#: xpack/plugins/interface/views.py:53
msgid "Restore default successfully!"
msgstr "恢复默认成功!"
#: xpack/plugins/license/meta.py:11 xpack/plugins/license/models.py:94
#: xpack/plugins/license/meta.py:11 xpack/plugins/license/models.py:94
#: xpack/plugins/license/templates/license/license_detail.html:50
#: xpack/plugins/license/templates/license/license_detail.html:50
#: xpack/plugins/license/templates/license/license_detail.html:55
#: xpack/plugins/license/templates/license/license_detail.html:55
...
@@ -5817,6 +5883,45 @@ msgstr "更新组织"
...
@@ -5817,6 +5883,45 @@ msgstr "更新组织"
#~ msgid "Update user groups"
#~ msgid "Update user groups"
#~ msgstr "更新用户组"
#~ msgstr "更新用户组"
# msgid "Update user"
# msgstr "更新用户"
#~ msgid ""
#~ "\n"
#~ " <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/"
#~ "bootstrap/3.2.0/css/bootstrap.min.css\">\n"
#~ " <p style=\"text-indent:2em;\">\n"
#~ " <span>\n"
#~ " <a href=\"%(rest_password_url)s?token="
#~ "%(rest_password_token)s\">click here to set your password</a>\n"
#~ " </span> \n"
#~ " <span>\n"
#~ " This link is valid for 1 hour. After it expires, <a href="
#~ "\"%(forget_password_url)s?email=%(email)s\">request new one</a>\n"
#~ " </span> \n"
#~ " <span>\n"
#~ " <a href=\"%(login_url)s\">Login direct</a>\n"
#~ " </span>\n"
#~ " </p>\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ " <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/"
#~ "bootstrap/3.2.0/css/bootstrap.min.css\">\n"
#~ " <p style=\"text-indent:2em;\">\n"
#~ " <span>\n"
#~ " <a href=\"%(rest_password_url)s?token="
#~ "%(rest_password_token)s\">请点击这里设置密码</a>\n"
#~ " </span> \n"
#~ " <span>\n"
#~ " 这个链接有效期1小时, 超过时间您可以, <a href="
#~ "\"%(forget_password_url)s?email=%(email)s\">重新申请</a>\n"
#~ " </span> \n"
#~ " <span>\n"
#~ " <a href=\"%(login_url)s\">Login direct</a>\n"
#~ " </span>\n"
#~ " </p>\n"
#~ " "
#~ msgid "Template"
#~ msgid "Template"
#~ msgstr "模板"
#~ msgstr "模板"
...
@@ -5851,9 +5956,6 @@ msgstr "更新组织"
...
@@ -5851,9 +5956,6 @@ msgstr "更新组织"
#~ msgid "Select host"
#~ msgid "Select host"
#~ msgstr "选择资产"
#~ msgstr "选择资产"
#~ msgid "Restore default successfully!"
#~ msgstr "恢复默认成功!"
#~ msgid "Beijing Duizhan Tech, Inc."
#~ msgid "Beijing Duizhan Tech, Inc."
#~ msgstr "北京堆栈科技有限公司"
#~ msgstr "北京堆栈科技有限公司"
...
...
apps/perms/api/user_permission.py
View file @
b237cbb2
...
@@ -512,6 +512,7 @@ class UserGrantedRemoteAppsAsTreeApi(ListAPIView):
...
@@ -512,6 +512,7 @@ class UserGrantedRemoteAppsAsTreeApi(ListAPIView):
class
ValidateUserRemoteAppPermissionApi
(
APIView
):
class
ValidateUserRemoteAppPermissionApi
(
APIView
):
permission_classes
=
(
IsOrgAdminOrAppUser
,)
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
user_id
=
request
.
query_params
.
get
(
'user_id'
,
''
)
user_id
=
request
.
query_params
.
get
(
'user_id'
,
''
)
...
...
apps/settings/api.py
View file @
b237cbb2
...
@@ -79,7 +79,7 @@ class LDAPTestingAPI(APIView):
...
@@ -79,7 +79,7 @@ class LDAPTestingAPI(APIView):
util
=
self
.
get_ldap_util
(
serializer
)
util
=
self
.
get_ldap_util
(
serializer
)
try
:
try
:
users
=
util
.
get_
search_user_items
()
users
=
util
.
search_user_items
()
except
Exception
as
e
:
except
Exception
as
e
:
return
Response
({
"error"
:
str
(
e
)},
status
=
401
)
return
Response
({
"error"
:
str
(
e
)},
status
=
401
)
...
@@ -95,7 +95,7 @@ class LDAPUserListApi(APIView):
...
@@ -95,7 +95,7 @@ class LDAPUserListApi(APIView):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
util
=
LDAPUtil
()
util
=
LDAPUtil
()
try
:
try
:
users
=
util
.
get_
search_user_items
()
users
=
util
.
search_user_items
()
except
Exception
as
e
:
except
Exception
as
e
:
users
=
[]
users
=
[]
logger
.
error
(
e
,
exc_info
=
True
)
logger
.
error
(
e
,
exc_info
=
True
)
...
@@ -108,11 +108,11 @@ class LDAPUserSyncAPI(APIView):
...
@@ -108,11 +108,11 @@ class LDAPUserSyncAPI(APIView):
permission_classes
=
(
IsOrgAdmin
,)
permission_classes
=
(
IsOrgAdmin
,)
def
post
(
self
,
request
):
def
post
(
self
,
request
):
user
_names
=
request
.
data
.
get
(
'user_names'
,
''
)
user
name_list
=
request
.
data
.
get
(
'username_list'
,
[]
)
util
=
LDAPUtil
()
util
=
LDAPUtil
()
try
:
try
:
result
=
util
.
sync_users
(
username_
set
=
user_names
)
result
=
util
.
sync_users
(
username_
list
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
e
,
exc_info
=
True
)
logger
.
error
(
e
,
exc_info
=
True
)
return
Response
({
'error'
:
str
(
e
)},
status
=
401
)
return
Response
({
'error'
:
str
(
e
)},
status
=
401
)
...
...
apps/settings/forms.py
View file @
b237cbb2
...
@@ -242,3 +242,26 @@ class SecuritySettingForm(BaseForm):
...
@@ -242,3 +242,26 @@ class SecuritySettingForm(BaseForm):
'and resets must contain special characters'
)
'and resets must contain special characters'
)
)
)
class
EmailContentSettingForm
(
BaseForm
):
EMAIL_CUSTOM_USER_CREATED_SUBJECT
=
forms
.
CharField
(
max_length
=
1024
,
required
=
False
,
label
=
_
(
"Create user email subject"
),
help_text
=
_
(
"Tips: When creating a user, send the subject of the email"
" (eg:Create account successfully)"
)
)
EMAIL_CUSTOM_USER_CREATED_HONORIFIC
=
forms
.
CharField
(
max_length
=
1024
,
required
=
False
,
label
=
_
(
"Create user honorific"
),
help_text
=
_
(
"Tips: When creating a user, send the honorific of the "
"email (eg:Hello)"
)
)
EMAIL_CUSTOM_USER_CREATED_BODY
=
forms
.
CharField
(
max_length
=
4096
,
required
=
False
,
widget
=
forms
.
Textarea
(),
label
=
_
(
'Create user email content'
),
help_text
=
_
(
'Tips:When creating a user, send the content of the email'
)
)
EMAIL_CUSTOM_USER_CREATED_SIGNATURE
=
forms
.
CharField
(
max_length
=
512
,
required
=
False
,
label
=
_
(
"Signature"
),
help_text
=
_
(
"Tips: Email signature (eg:jumpserver)"
)
)
apps/settings/templates/settings/_ldap_list_users_modal.html
View file @
b237cbb2
...
@@ -58,6 +58,9 @@ function initLdapUsersTable() {
...
@@ -58,6 +58,9 @@ function initLdapUsersTable() {
ele
:
$
(
'#ldap_list_users_table'
),
ele
:
$
(
'#ldap_list_users_table'
),
ajax_url
:
'{% url "api-settings:ldap-user-list" %}'
,
ajax_url
:
'{% url "api-settings:ldap-user-list" %}'
,
columnDefs
:
[
columnDefs
:
[
{
targets
:
0
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
$
(
td
).
html
(
"<input type='checkbox' class='text-center ipt_check' id='ID_USERNAME'>"
.
replace
(
"ID_USERNAME"
,
cellData
))
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
if
(
cellData
){
if
(
cellData
){
$
(
td
).
html
(
'<i class="fa fa-check text-navy"></i>'
)
$
(
td
).
html
(
'<i class="fa fa-check text-navy"></i>'
)
...
...
apps/settings/templates/settings/basic_setting.html
View file @
b237cbb2
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
</li>
<li>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
<li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
</li>
</li>
...
...
apps/settings/templates/settings/email_content_setting.html
0 → 100644
View file @
b237cbb2
{% extends 'base.html' %}
{% load static %}
{% load bootstrap3 %}
{% load i18n %}
{% load common_tags %}
{% block content %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li>
<a
href=
"{% url 'settings:basic-setting' %}"
class=
"text-center"
><i
class=
"fa fa-cubes"
></i>
{% trans 'Basic setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
<li
class=
"active"
>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:terminal-setting' %}"
class=
"text-center"
><i
class=
"fa fa-hdd-o"
></i>
{% trans 'Terminal setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:security-setting' %}"
class=
"text-center"
><i
class=
"fa fa-lock"
></i>
{% trans 'Security setting' %}
</a>
</li>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"col-sm-12"
style=
"padding-left:0"
>
<div
class=
"ibox-content"
style=
"border-width: 0;padding-top: 40px;"
>
<form
action=
""
method=
"post"
class=
"form-horizontal"
>
{% if form.non_field_errors %}
<div
class=
"alert alert-danger"
>
{{ form.non_field_errors }}
</div>
{% endif %}
{% csrf_token %}
<h3>
{% trans "Create User setting" %}
</h3>
{% bootstrap_field form.EMAIL_CUSTOM_USER_CREATED_SUBJECT layout="horizontal" %}
{% bootstrap_field form.EMAIL_CUSTOM_USER_CREATED_HONORIFIC layout="horizontal" %}
{% bootstrap_field form.EMAIL_CUSTOM_USER_CREATED_BODY layout="horizontal" %}
{% bootstrap_field form.EMAIL_CUSTOM_USER_CREATED_SIGNATURE layout="horizontal" %}
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-default"
type=
"reset"
>
{% trans 'Reset' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans 'Submit' %}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block custom_foot_js %}
<script>
</script>
{% endblock %}
apps/settings/templates/settings/email_setting.html
View file @
b237cbb2
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<li
class=
"active"
>
<li
class=
"active"
>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
</li>
<li>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
<li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
</li>
</li>
...
...
apps/settings/templates/settings/ldap_setting.html
View file @
b237cbb2
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
</li>
<li>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
<li
class=
"active"
>
<li
class=
"active"
>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
</li>
</li>
...
@@ -107,13 +110,13 @@ $(document).ready(function () {
...
@@ -107,13 +110,13 @@ $(document).ready(function () {
});
});
})
})
.
on
(
"click"
,
"#btn_ldap_modal_confirm"
,
function
()
{
.
on
(
"click"
,
"#btn_ldap_modal_confirm"
,
function
()
{
var
user
_names
=
[];
var
user
name_list
=
[];
$
(
"tbody input[type='checkbox']:checked"
).
each
(
function
()
{
$
(
"tbody input[type='checkbox']:checked"
).
each
(
function
()
{
user
_names
.
push
(
$
(
this
).
attr
(
'id'
));
user
name_list
.
push
(
$
(
this
).
attr
(
'id'
));
});
});
if
(
user
_names
.
length
===
0
){
if
(
user
name_list
.
length
===
0
){
var
msg
=
"{% trans 'User is not currently selected, please check the user you want to import'%}"
var
msg
=
"{% trans 'User is not currently selected, please check the user you want to import'%}"
;
toastr
.
error
(
msg
);
toastr
.
error
(
msg
);
return
return
}
}
...
@@ -129,7 +132,7 @@ $(document).ready(function () {
...
@@ -129,7 +132,7 @@ $(document).ready(function () {
}
}
APIUpdateAttr
({
APIUpdateAttr
({
url
:
the_url
,
url
:
the_url
,
body
:
JSON
.
stringify
({
'user
_names'
:
user_names
}),
body
:
JSON
.
stringify
({
'user
name_list'
:
username_list
}),
method
:
"POST"
,
method
:
"POST"
,
flash_message
:
false
,
flash_message
:
false
,
success
:
success
,
success
:
success
,
...
...
apps/settings/templates/settings/security_setting.html
View file @
b237cbb2
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
</li>
</li>
<li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
</li>
<li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
...
...
apps/settings/templates/settings/terminal_setting.html
View file @
b237cbb2
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
<li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:email-content-setting' %}"
class=
"text-center"
><i
class=
"fa fa-file-text"
></i>
{% trans 'Email content setting' %}
</a>
</li>
</li>
<li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
...
...
apps/settings/urls/view_urls.py
View file @
b237cbb2
...
@@ -9,6 +9,7 @@ app_name = 'common'
...
@@ -9,6 +9,7 @@ app_name = 'common'
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^$'
,
views
.
BasicSettingView
.
as_view
(),
name
=
'basic-setting'
),
url
(
r'^$'
,
views
.
BasicSettingView
.
as_view
(),
name
=
'basic-setting'
),
url
(
r'^email/$'
,
views
.
EmailSettingView
.
as_view
(),
name
=
'email-setting'
),
url
(
r'^email/$'
,
views
.
EmailSettingView
.
as_view
(),
name
=
'email-setting'
),
url
(
r'^email-content/$'
,
views
.
EmailContentSettingView
.
as_view
(),
name
=
'email-content-setting'
),
url
(
r'^ldap/$'
,
views
.
LDAPSettingView
.
as_view
(),
name
=
'ldap-setting'
),
url
(
r'^ldap/$'
,
views
.
LDAPSettingView
.
as_view
(),
name
=
'ldap-setting'
),
url
(
r'^terminal/$'
,
views
.
TerminalSettingView
.
as_view
(),
name
=
'terminal-setting'
),
url
(
r'^terminal/$'
,
views
.
TerminalSettingView
.
as_view
(),
name
=
'terminal-setting'
),
url
(
r'^terminal/replay-storage/create$'
,
views
.
ReplayStorageCreateView
.
as_view
(),
name
=
'replay-storage-create'
),
url
(
r'^terminal/replay-storage/create$'
,
views
.
ReplayStorageCreateView
.
as_view
(),
name
=
'replay-storage-create'
),
...
...
apps/settings/utils.py
View file @
b237cbb2
...
@@ -5,7 +5,9 @@ from ldap3 import Server, Connection
...
@@ -5,7 +5,9 @@ from ldap3 import Server, Connection
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
users.models
import
User
from
users.models
import
User
from
users.utils
import
construct_user_email
from
common.utils
import
get_logger
from
common.utils
import
get_logger
from
.models
import
settings
from
.models
import
settings
...
@@ -17,11 +19,11 @@ class LDAPOUGroupException(Exception):
...
@@ -17,11 +19,11 @@ class LDAPOUGroupException(Exception):
class
LDAPUtil
:
class
LDAPUtil
:
_conn
=
None
def
__init__
(
self
,
use_settings_config
=
True
,
server_uri
=
None
,
bind_dn
=
None
,
def
__init__
(
self
,
use_settings_config
=
True
,
server_uri
=
None
,
bind_dn
=
None
,
password
=
None
,
use_ssl
=
None
,
search_ougroup
=
None
,
password
=
None
,
use_ssl
=
None
,
search_ougroup
=
None
,
search_filter
=
None
,
attr_map
=
None
,
auth_ldap
=
None
):
search_filter
=
None
,
attr_map
=
None
,
auth_ldap
=
None
):
# config
# config
if
use_settings_config
:
if
use_settings_config
:
self
.
_load_config_from_settings
()
self
.
_load_config_from_settings
()
...
@@ -45,6 +47,15 @@ class LDAPUtil:
...
@@ -45,6 +47,15 @@ class LDAPUtil:
self
.
attr_map
=
settings
.
AUTH_LDAP_USER_ATTR_MAP
self
.
attr_map
=
settings
.
AUTH_LDAP_USER_ATTR_MAP
self
.
auth_ldap
=
settings
.
AUTH_LDAP
self
.
auth_ldap
=
settings
.
AUTH_LDAP
@property
def
connection
(
self
):
if
self
.
_conn
is
None
:
server
=
Server
(
self
.
server_uri
,
use_ssl
=
self
.
use_ssl
)
conn
=
Connection
(
server
,
self
.
bind_dn
,
self
.
password
)
conn
.
bind
()
self
.
_conn
=
conn
return
self
.
_conn
@staticmethod
@staticmethod
def
get_user_by_username
(
username
):
def
get_user_by_username
(
username
):
try
:
try
:
...
@@ -55,36 +66,64 @@ class LDAPUtil:
...
@@ -55,36 +66,64 @@ class LDAPUtil:
else
:
else
:
return
user
return
user
def
_ldap_entry_to_user_item
(
self
,
entry
):
user_item
=
{}
for
attr
,
mapping
in
self
.
attr_map
.
items
():
if
not
hasattr
(
entry
,
mapping
):
continue
user_item
[
attr
]
=
getattr
(
entry
,
mapping
)
.
value
or
''
return
user_item
def
search_user_items
(
self
):
user_items
=
[]
for
search_ou
in
str
(
self
.
search_ougroup
)
.
split
(
"|"
):
ok
=
self
.
connection
.
search
(
search_ou
,
self
.
search_filter
%
({
"user"
:
"*"
}),
attributes
=
list
(
self
.
attr_map
.
values
())
)
if
not
ok
:
error
=
_
(
"Search no entry matched in ou {}"
.
format
(
search_ou
))
raise
LDAPOUGroupException
(
error
)
for
entry
in
self
.
connection
.
entries
:
user_item
=
self
.
_ldap_entry_to_user_item
(
entry
)
user
=
self
.
get_user_by_username
(
user_item
[
'username'
])
user_item
[
'existing'
]
=
bool
(
user
)
user_items
.
append
(
user_item
)
return
user_items
def
search_filter_user_items
(
self
,
username_list
):
user_items
=
self
.
search_user_items
()
if
username_list
:
user_items
=
[
u
for
u
in
user_items
if
u
[
'username'
]
in
username_list
]
return
user_items
@staticmethod
@staticmethod
def
_updat
e_user
(
user
,
user_item
):
def
sav
e_user
(
user
,
user_item
):
for
field
,
value
in
user_item
.
items
():
for
field
,
value
in
user_item
.
items
():
if
not
hasattr
(
user
,
field
):
if
not
hasattr
(
user
,
field
):
continue
continue
if
isinstance
(
getattr
(
user
,
field
),
bool
):
value
=
value
.
lower
()
in
[
'true'
,
1
]
setattr
(
user
,
field
,
value
)
setattr
(
user
,
field
,
value
)
user
.
save
()
user
.
save
()
def
update_user
(
self
,
user_item
):
def
update_user
(
self
,
user_item
):
user
=
self
.
get_user_by_username
(
user_item
[
'username'
])
user
=
self
.
get_user_by_username
(
user_item
[
'username'
])
if
not
user
:
msg
=
_
(
'User does not exist'
)
return
False
,
msg
if
user
.
source
!=
User
.
SOURCE_LDAP
:
if
user
.
source
!=
User
.
SOURCE_LDAP
:
msg
=
_
(
'The user source is not LDAP'
)
msg
=
_
(
'The user source is not LDAP'
)
return
False
,
msg
return
False
,
msg
try
:
try
:
self
.
_updat
e_user
(
user
,
user_item
)
self
.
sav
e_user
(
user
,
user_item
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
e
,
exc_info
=
True
)
logger
.
error
(
e
,
exc_info
=
True
)
return
False
,
str
(
e
)
return
False
,
str
(
e
)
else
:
else
:
return
True
,
None
return
True
,
None
@staticmethod
def
create_user
(
self
,
user_item
):
def
create_user
(
user_item
):
user
=
User
(
source
=
User
.
SOURCE_LDAP
)
user_item
[
'source'
]
=
User
.
SOURCE_LDAP
try
:
try
:
User
.
objects
.
create
(
**
user_item
)
self
.
save_user
(
user
,
user_item
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
e
,
exc_info
=
True
)
logger
.
error
(
e
,
exc_info
=
True
)
return
False
,
str
(
e
)
return
False
,
str
(
e
)
...
@@ -92,26 +131,21 @@ class LDAPUtil:
...
@@ -92,26 +131,21 @@ class LDAPUtil:
return
True
,
None
return
True
,
None
@staticmethod
@staticmethod
def
get_or_construct_email
(
user_item
):
def
construct_user_email
(
user_item
):
if
not
user_item
.
get
(
'email'
,
None
):
username
=
user_item
[
'username'
]
if
'@'
in
user_item
[
'username'
]:
email
=
user_item
.
get
(
'email'
,
''
)
email
=
user_item
[
'username'
]
email
=
construct_user_email
(
username
,
email
)
else
:
email
=
'{}@{}'
.
format
(
user_item
[
'username'
],
settings
.
EMAIL_SUFFIX
)
else
:
email
=
user_item
[
'email'
]
return
email
return
email
def
create_or_update_users
(
self
,
user_items
,
force_update
=
True
):
def
create_or_update_users
(
self
,
user_items
,
force_update
=
True
):
succeed
=
failed
=
0
succeed
=
failed
=
0
for
user_item
in
user_items
:
for
user_item
in
user_items
:
user_item
[
'email'
]
=
self
.
get_or_construct_email
(
user_item
)
exist
=
user_item
.
pop
(
'existing'
,
False
)
exist
=
user_item
.
pop
(
'existing'
,
None
)
user_item
[
'email'
]
=
self
.
construct_user_email
(
user_item
)
if
exist
:
if
not
exist
:
ok
,
error
=
self
.
update_user
(
user_item
)
else
:
ok
,
error
=
self
.
create_user
(
user_item
)
ok
,
error
=
self
.
create_user
(
user_item
)
else
:
ok
,
error
=
self
.
update_user
(
user_item
)
if
not
ok
:
if
not
ok
:
failed
+=
1
failed
+=
1
else
:
else
:
...
@@ -119,44 +153,7 @@ class LDAPUtil:
...
@@ -119,44 +153,7 @@ class LDAPUtil:
result
=
{
'total'
:
len
(
user_items
),
'succeed'
:
succeed
,
'failed'
:
failed
}
result
=
{
'total'
:
len
(
user_items
),
'succeed'
:
succeed
,
'failed'
:
failed
}
return
result
return
result
def
_ldap_entry_to_user_item
(
self
,
entry
):
def
sync_users
(
self
,
username_list
):
user_item
=
{}
user_items
=
self
.
search_filter_user_items
(
username_list
)
for
attr
,
mapping
in
self
.
attr_map
.
items
():
if
not
hasattr
(
entry
,
mapping
):
continue
user_item
[
attr
]
=
getattr
(
entry
,
mapping
)
.
value
or
''
return
user_item
def
get_connection
(
self
):
server
=
Server
(
self
.
server_uri
,
use_ssl
=
self
.
use_ssl
)
conn
=
Connection
(
server
,
self
.
bind_dn
,
self
.
password
)
conn
.
bind
()
return
conn
def
get_search_user_items
(
self
):
conn
=
self
.
get_connection
()
user_items
=
[]
search_ougroup
=
str
(
self
.
search_ougroup
)
.
split
(
"|"
)
for
search_ou
in
search_ougroup
:
ok
=
conn
.
search
(
search_ou
,
self
.
search_filter
%
({
"user"
:
"*"
}),
attributes
=
list
(
self
.
attr_map
.
values
())
)
if
not
ok
:
error
=
_
(
"Search no entry matched in ou {}"
.
format
(
search_ou
))
raise
LDAPOUGroupException
(
error
)
for
entry
in
conn
.
entries
:
user_item
=
self
.
_ldap_entry_to_user_item
(
entry
)
user
=
self
.
get_user_by_username
(
user_item
[
'username'
])
user_item
[
'existing'
]
=
bool
(
user
)
user_items
.
append
(
user_item
)
return
user_items
def
sync_users
(
self
,
username_set
):
user_items
=
self
.
get_search_user_items
()
if
username_set
:
user_items
=
[
u
for
u
in
user_items
if
u
[
'username'
]
in
username_set
]
result
=
self
.
create_or_update_users
(
user_items
)
result
=
self
.
create_or_update_users
(
user_items
)
return
result
return
result
apps/settings/views.py
View file @
b237cbb2
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext as _
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext as _
from
common.permissions
import
SuperUserRequiredMixin
from
common.permissions
import
SuperUserRequiredMixin
from
common
import
utils
from
common
import
utils
from
.forms
import
EmailSettingForm
,
LDAPSettingForm
,
BasicSettingForm
,
\
from
.forms
import
EmailSettingForm
,
LDAPSettingForm
,
BasicSettingForm
,
\
TerminalSettingForm
,
SecuritySettingForm
TerminalSettingForm
,
SecuritySettingForm
,
EmailContentSettingForm
class
BasicSettingView
(
SuperUserRequiredMixin
,
TemplateView
):
class
BasicSettingView
(
SuperUserRequiredMixin
,
TemplateView
):
...
@@ -166,3 +166,29 @@ class SecuritySettingView(SuperUserRequiredMixin, TemplateView):
...
@@ -166,3 +166,29 @@ class SecuritySettingView(SuperUserRequiredMixin, TemplateView):
context
=
self
.
get_context_data
()
context
=
self
.
get_context_data
()
context
.
update
({
"form"
:
form
})
context
.
update
({
"form"
:
form
})
return
render
(
request
,
self
.
template_name
,
context
)
return
render
(
request
,
self
.
template_name
,
context
)
class
EmailContentSettingView
(
SuperUserRequiredMixin
,
TemplateView
):
template_name
=
"settings/email_content_setting.html"
form_class
=
EmailContentSettingForm
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
'app'
:
_
(
'Settings'
),
'action'
:
_
(
'Email content setting'
),
'form'
:
self
.
form_class
(),
}
kwargs
.
update
(
context
)
return
super
()
.
get_context_data
(
**
kwargs
)
def
post
(
self
,
request
):
form
=
self
.
form_class
(
request
.
POST
)
if
form
.
is_valid
():
form
.
save
()
msg
=
_
(
"Update setting successfully"
)
messages
.
success
(
request
,
msg
)
return
redirect
(
'settings:email-content-setting'
)
else
:
context
=
self
.
get_context_data
()
context
.
update
({
"form"
:
form
})
return
render
(
request
,
self
.
template_name
,
context
)
apps/users/utils.py
View file @
b237cbb2
...
@@ -34,29 +34,24 @@ class AdminUserRequiredMixin(UserPassesTestMixin):
...
@@ -34,29 +34,24 @@ class AdminUserRequiredMixin(UserPassesTestMixin):
return
True
return
True
def
send_user_created_mail
(
user
):
def
construct_user_created_email_body
(
user
):
subject
=
_
(
'Create account successfully'
)
default_body
=
_
(
"""
recipient_list
=
[
user
.
email
]
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
message
=
_
(
"""
<p style="text-indent:2em;">
Hello
%(name)
s:
<span>
</br>
Username:
%(username)
s.
Your account has been created successfully
</span>
</br>
<span>
Username:
%(username)
s
<a href="
%(rest_password_url)
s?token=
%(rest_password_token)
s">click here to set your password</a>
</br>
</span>
<a href="
%(rest_password_url)
s?token=
%(rest_password_token)
s">click here to set your password</a>
<span>
</br>
This link is valid for 1 hour. After it expires, <a href="
%(forget_password_url)
s?email=
%(email)
s">request new one</a>
This link is valid for 1 hour. After it expires, <a href="
%(forget_password_url)
s?email=
%(email)
s">request new one</a>
</span>
<span>
</br>
<a href="
%(login_url)
s">Login direct</a>
---
</span>
</p>
</br>
"""
)
%
{
<a href="
%(login_url)
s">Login direct</a>
</br>
"""
)
%
{
'name'
:
user
.
name
,
'username'
:
user
.
username
,
'username'
:
user
.
username
,
'rest_password_url'
:
reverse
(
'users:reset-password'
,
external
=
True
),
'rest_password_url'
:
reverse
(
'users:reset-password'
,
external
=
True
),
'rest_password_token'
:
user
.
generate_reset_token
(),
'rest_password_token'
:
user
.
generate_reset_token
(),
...
@@ -64,6 +59,32 @@ def send_user_created_mail(user):
...
@@ -64,6 +59,32 @@ def send_user_created_mail(user):
'email'
:
user
.
email
,
'email'
:
user
.
email
,
'login_url'
:
reverse
(
'authentication:login'
,
external
=
True
),
'login_url'
:
reverse
(
'authentication:login'
,
external
=
True
),
}
}
if
settings
.
EMAIL_CUSTOM_USER_CREATED_BODY
:
custom_body
=
'<p style="text-indent:2em">'
+
settings
.
EMAIL_CUSTOM_USER_CREATED_BODY
+
'</p>'
else
:
custom_body
=
''
body
=
custom_body
+
default_body
return
body
def
send_user_created_mail
(
user
):
recipient_list
=
[
user
.
email
]
subject
=
_
(
'Create account successfully'
)
if
settings
.
EMAIL_CUSTOM_USER_CREATED_SUBJECT
:
subject
=
settings
.
EMAIL_CUSTOM_USER_CREATED_SUBJECT
honorific
=
'<p>'
+
_
(
'Hello
%(name)
s'
)
%
{
'name'
:
user
.
name
}
+
':</p>'
if
settings
.
EMAIL_CUSTOM_USER_CREATED_HONORIFIC
:
honorific
=
'<p>'
+
settings
.
EMAIL_CUSTOM_USER_CREATED_HONORIFIC
+
':</p>'
body
=
construct_user_created_email_body
(
user
)
signature
=
'<p style="float:right">jumpserver</p>'
if
settings
.
EMAIL_CUSTOM_USER_CREATED_SIGNATURE
:
signature
=
'<p style="float:right">'
+
settings
.
EMAIL_CUSTOM_USER_CREATED_SIGNATURE
+
'</p>'
message
=
honorific
+
body
+
signature
if
settings
.
DEBUG
:
if
settings
.
DEBUG
:
try
:
try
:
print
(
message
)
print
(
message
)
...
@@ -313,3 +334,13 @@ def is_need_unblock(key_block):
...
@@ -313,3 +334,13 @@ def is_need_unblock(key_block):
if
not
cache
.
get
(
key_block
):
if
not
cache
.
get
(
key_block
):
return
False
return
False
return
True
return
True
def
construct_user_email
(
username
,
email
):
if
'@'
not
in
email
:
if
'@'
in
username
:
email
=
username
else
:
email
=
'{}@{}'
.
format
(
username
,
settings
.
EMAIL_SUFFIX
)
return
email
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