Commit e06b48ab authored by Georges Khaznadar's avatar Georges Khaznadar

removed ldap3 stuff

parent 69693cee
......@@ -11,8 +11,6 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
from ldap3 import Server, Connection
import django_python3_ldap.utils
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -39,7 +37,6 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_python3_ldap',
'pose',
]
......@@ -109,7 +106,6 @@ AUTH_PASSWORD_VALIDATORS = [
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
"django_python3_ldap.auth.LDAPBackend",
]
......@@ -136,35 +132,3 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static')
MEDIA_URL = '/photos/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'photos')
# LDAP connection
server = Server('localhost', port=1389)
connection = Connection(server)
connection.bind()
############# for the LDAP AUTH BACKEND ########################
# The URL of the LDAP server.
LDAP_AUTH_URL = "ldap://localhost:1389"
# The LDAP search base for looking up users.
LDAP_AUTH_SEARCH_BASE = "ou=Users,dc=lycee,dc=jb"
# The LDAP class that represents a user.
LDAP_AUTH_OBJECT_CLASS = "kwartzAccount"
# User model fields mapped to the LDAP
# attributes that represent them.
LDAP_AUTH_USER_FIELDS = {
"username": "uid",
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}
# A tuple of fields used to uniquely identify a user.
LDAP_AUTH_USER_LOOKUP_FIELDS = ("username",)
# Callable that transforms the user data loaded from
# LDAP into a form suitable for creating a user.
# Override this to set custom field formatting for your
# user model.
LDAP_AUTH_CLEAN_USER_DATA = django_python3_ldap.utils.clean_user_data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment