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/app-01-settings.py.patch

29 lines
838 B
Diff
Raw Normal View History

2021-03-23 17:33:02 +01:00
diff --git a/mygpo/settings.py b/mygpo/settings.py
index 33bd283f..2666ade6 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