Skip to content

Commit

Permalink
update ldap settings (#1922)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Sep 5, 2024
1 parent 389b64e commit 83b6f62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

import itertools
import os
import re

Expand Down Expand Up @@ -356,7 +357,6 @@
LDAP_ALT_DOMAINS = env.list('LDAP_ALT_DOMAINS', None, default=[])

if ENABLE_LDAP:
import itertools
import ldap
from django_auth_ldap.config import LDAPSearch

Expand Down Expand Up @@ -385,8 +385,9 @@
AUTH_LDAP_USER_FILTER = env.str(
'AUTH_LDAP_USER_FILTER', '(sAMAccountName=%(user)s)'
)
AUTH_LDAP_USER_SEARCH_BASE = env.str('AUTH_LDAP_USER_SEARCH_BASE', None)
AUTH_LDAP_USER_SEARCH = LDAPSearch(
env.str('AUTH_LDAP_USER_SEARCH_BASE', None),
AUTH_LDAP_USER_SEARCH_BASE,
ldap.SCOPE_SUBTREE,
AUTH_LDAP_USER_FILTER,
)
Expand Down Expand Up @@ -418,8 +419,11 @@
AUTH_LDAP2_USER_FILTER = env.str(
'AUTH_LDAP2_USER_FILTER', '(sAMAccountName=%(user)s)'
)
AUTH_LDAP2_USER_SEARCH_BASE = env.str(
'AUTH_LDAP2_USER_SEARCH_BASE', None
)
AUTH_LDAP2_USER_SEARCH = LDAPSearch(
env.str('AUTH_LDAP2_USER_SEARCH_BASE', None),
AUTH_LDAP2_USER_SEARCH_BASE,
ldap.SCOPE_SUBTREE,
AUTH_LDAP2_USER_FILTER,
)
Expand Down

0 comments on commit 83b6f62

Please sign in to comment.