mirror of
https://github.com/YunoHost-Apps/mygpo_ynh.git
synced 2024-09-03 19:55:52 +02:00
8284155ea3
* Update to 1627ed9d3dddb2a6d0fb85b598d7736f19a06b47 * Update to 2021-06-16 * Update to 2021-09-13 * Update to version 2021-10-11 * use `makemigrations --merge` on migrate * Update 20 version 2021-10-20 * Apply example_ynh * Auto-update README * Fix upgrade * fix datadir Co-authored-by: Jules Bertholet <jules.bertholet@quoi.xyz> Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: Yunohost-Bot <>
29 lines
838 B
Diff
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
|
|
|