1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mygpo_ynh.git synced 2024-09-03 19:55:52 +02:00
mygpo_ynh/sources/patches/main-01-settings.py.patch

29 lines
838 B
Diff

diff --git a/mygpo/settings.py b/mygpo/settings.py
index b3927315..f295c326 100644
--- a/mygpo/settings.py
+++ b/mygpo/settings.py
@@ -2,6 +2,7 @@ import re
import sys
import os.path
import dj_database_url
+import ldap
try:
@@ -209,10 +210,15 @@ except ImportError:
ACCOUNT_ACTIVATION_DAYS = int(os.getenv("ACCOUNT_ACTIVATION_DAYS", 7))
AUTHENTICATION_BACKENDS = (
+ "django_auth_ldap.backend.LDAPBackend",
"mygpo.users.backend.CaseInsensitiveModelBackend",
"mygpo.web.auth.EmailAuthenticationBackend",
)
+AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=users,dc=yunohost,dc=org"
+
+AUTH_LDAP_USER_ATTR_MAP = {"username": "uid", "first_name": "givenName", "email": "mail", "last_name": "sn"}
+
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
# TODO: use (default) JSON serializer for security