Skip to content

Commit 21a7202

Browse files
committed
[Bugfix] 修复ldap认证bug
1 parent 02cd3b1 commit 21a7202

4 files changed

Lines changed: 247 additions & 252 deletions

File tree

apps/assets/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Meta:
127127
attrs={'class': 'select2', 'data-placeholder': _('Select asset groups')}
128128
),
129129
'labels': forms.SelectMultiple(
130-
attrs={'class': 'select2', 'data-placeholder': _('Select lables')}
130+
attrs={'class': 'select2', 'data-placeholder': _('Select labels')}
131131
),
132132
}
133133

apps/common/forms.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,24 @@ class LDAPSettingForm(BaseForm):
117117
label=_("User OU"), initial='ou=tech,dc=jumpserver,dc=org'
118118
)
119119
AUTH_LDAP_SEARCH_FILTER = forms.CharField(
120-
label=_("User search filter"), initial='(cn=%(user)s)'
120+
label=_("User search filter"), initial='(cn=%(user)s)',
121+
help_text=_("User search filter must contain ([cn,uid,sAMAccountName,...]=%(user)s)")
121122
)
122123
AUTH_LDAP_USER_ATTR_MAP = DictField(
123124
label=_("User attr map"),
124125
initial=json.dumps({
125126
"username": "cn",
126127
"name": "sn",
127128
"email": "mail"
128-
})
129+
}),
130+
help_text=_("User attr map present how to map LDAP user attr to jumpserver, username,name,email is jumpserver attr")
129131
)
130132
# AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU
131133
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
132134
AUTH_LDAP_START_TLS = forms.BooleanField(
133135
label=_("Use SSL"), initial=False, required=False
134136
)
137+
AUTH_LDAP = forms.BooleanField(label=_("Enable LDAP auth"), initial=False)
135138

136139

137140
class TerminalSettingForm(BaseForm):

apps/i18n/zh/LC_MESSAGES/django.mo

-470 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)