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
d08a1c3d
Commit
d08a1c3d
authored
Jan 17, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 启用ldap移动位置
parent
a77acb7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
forms.py
apps/common/forms.py
+3
-3
views.py
apps/common/views.py
+2
-2
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+1
-1
No files found.
apps/common/forms.py
View file @
d08a1c3d
...
@@ -72,9 +72,6 @@ class BasicSettingForm(BaseForm):
...
@@ -72,9 +72,6 @@ class BasicSettingForm(BaseForm):
max_length
=
1024
,
label
=
_
(
"Email Subject Prefix"
),
max_length
=
1024
,
label
=
_
(
"Email Subject Prefix"
),
initial
=
"[Jumpserver] "
initial
=
"[Jumpserver] "
)
)
AUTH_LDAP
=
forms
.
BooleanField
(
label
=
_
(
"Enable LDAP Auth"
),
initial
=
False
,
required
=
False
)
class
EmailSettingForm
(
BaseForm
):
class
EmailSettingForm
(
BaseForm
):
...
@@ -129,3 +126,6 @@ class LDAPSettingForm(BaseForm):
...
@@ -129,3 +126,6 @@ class LDAPSettingForm(BaseForm):
AUTH_LDAP_START_TLS
=
forms
.
BooleanField
(
AUTH_LDAP_START_TLS
=
forms
.
BooleanField
(
label
=
_
(
"Use SSL"
),
initial
=
False
,
required
=
False
label
=
_
(
"Use SSL"
),
initial
=
False
,
required
=
False
)
)
AUTH_LDAP
=
forms
.
BooleanField
(
label
=
_
(
"Enable LDAP Auth"
),
initial
=
False
,
required
=
False
)
apps/common/views.py
View file @
d08a1c3d
...
@@ -25,8 +25,6 @@ class BasicSettingView(AdminUserRequiredMixin, TemplateView):
...
@@ -25,8 +25,6 @@ class BasicSettingView(AdminUserRequiredMixin, TemplateView):
form
=
self
.
form_class
(
request
.
POST
)
form
=
self
.
form_class
(
request
.
POST
)
if
form
.
is_valid
():
if
form
.
is_valid
():
form
.
save
()
form
.
save
()
if
"AUTH_LDAP"
in
form
.
cleaned_data
:
ldap_auth_enable
.
send
(
form
.
cleaned_data
[
"AUTH_LDAP"
])
msg
=
_
(
"Update setting successfully, please restart program"
)
msg
=
_
(
"Update setting successfully, please restart program"
)
messages
.
success
(
request
,
msg
)
messages
.
success
(
request
,
msg
)
return
redirect
(
'settings:basic-setting'
)
return
redirect
(
'settings:basic-setting'
)
...
@@ -79,6 +77,8 @@ class LDAPSettingView(AdminUserRequiredMixin, TemplateView):
...
@@ -79,6 +77,8 @@ class LDAPSettingView(AdminUserRequiredMixin, TemplateView):
form
=
self
.
form_class
(
request
.
POST
)
form
=
self
.
form_class
(
request
.
POST
)
if
form
.
is_valid
():
if
form
.
is_valid
():
form
.
save
()
form
.
save
()
if
"AUTH_LDAP"
in
form
.
cleaned_data
:
ldap_auth_enable
.
send
(
form
.
cleaned_data
[
"AUTH_LDAP"
])
msg
=
_
(
"Update setting successfully, please restart program"
)
msg
=
_
(
"Update setting successfully, please restart program"
)
messages
.
success
(
request
,
msg
)
messages
.
success
(
request
,
msg
)
return
redirect
(
'settings:ldap-setting'
)
return
redirect
(
'settings:ldap-setting'
)
...
...
apps/locale/zh/LC_MESSAGES/django.mo
View file @
d08a1c3d
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
d08a1c3d
...
@@ -1311,7 +1311,7 @@ msgstr "Email主题前缀"
...
@@ -1311,7 +1311,7 @@ msgstr "Email主题前缀"
#: common/forms.py:76
#: common/forms.py:76
msgid "Enable LDAP Auth"
msgid "Enable LDAP Auth"
msgstr "LDAP认证"
msgstr "
开启
LDAP认证"
#: common/forms.py:82
#: common/forms.py:82
msgid "SMTP host"
msgid "SMTP host"
...
...
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