@@ -29,47 +29,42 @@ DATABASES = {
29
29
'USER': '{{ db_user }}',
30
30
'PASSWORD': '{{ db_pwd }}',
31
31
'HOST': '127.0.0.1',
32
- 'PORT': '5432',
32
+ 'PORT': '5432',
33
33
},
34
34
}
35
35
36
36
FEEDS = (('ffdn', 'http://www.ffdn.org/fr/rss.xml', 3),)
37
37
38
38
39
39
40
- # # Tous acces
41
- # # parametrer SSO en protect_uris
42
- # # OU
43
- # # Pas d'acces
44
- # # hook
45
- # # parametrer SSO en protect_uris
46
- # import ldap
47
- # from django_auth_ldap.config import LDAPSearch, PosixGroupType
48
- # AUTHENTICATION_BACKENDS = (
49
- # 'django_auth_ldap.backend.LDAPBackend',
50
- # 'django.contrib.auth.backends.ModelBackend',
51
- # )
52
- # AUTH_LDAP_SERVER_URI = "ldap://localhost:389"
53
- # AUTH_LDAP_USER_SEARCH = LDAPSearch("uid={{ admin }},ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
54
- # AUTH_LDAP_USER_ATTR_MAP = {
55
- # "username": "uid",
56
- # "first_name": "givenName",
57
- # "last_name": "sn",
58
- # "email": "mail",
59
- # }
60
- # AUTH_LDAP_USER_FLAGS_BY_GROUP = {
61
- # "is_active": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",
62
- # "is_staff": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",
63
- # "is_superuser": "cn=sftpusers,ou=groups,dc=yunohost,dc=org"
64
- # }
65
- # AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=groups,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(objectClass=posixGroup)")
66
- # AUTH_LDAP_GROUP_TYPE = PosixGroupType()
67
- # AUTH_LDAP_ALWAYS_UPDATE_USER = True
68
- # AUTH_LDAP_AUTHORIZE_ALL_USERS = True
69
- # AUTH_LDAP_FIND_GROUP_PERMS = True
70
- # #AUTH_LDAP_CACHE_GROUPS = True
71
- # #AUTH_LDAP_GROUP_CACHE_TIMEOUT = 300
72
- # #import logging
73
- # #logger = logging.getLogger('django_auth_ldap')
74
- # #logger.addHandler(logging.StreamHandler())
75
- # #logger.setLevel(logging.DEBUG)
40
+ # Tous acces
41
+ import ldap
42
+ from django_auth_ldap.config import LDAPSearch, MemberDNGroupType
43
+ AUTHENTICATION_BACKENDS = (
44
+ 'django_auth_ldap.backend.LDAPBackend',
45
+ 'django.contrib.auth.backends.ModelBackend',
46
+ )
47
+ AUTH_LDAP_SERVER_URI = "ldap://localhost:389"
48
+ AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
49
+ AUTH_LDAP_USER_ATTR_MAP = {
50
+ "username": "uid",
51
+ "first_name": "givenName",
52
+ "last_name": "sn",
53
+ "email": "mail",
54
+ }
55
+ AUTH_LDAP_USER_FLAGS_BY_GROUP = {
56
+ "is_active": "cn={{ app }}.main,ou=permission,dc=yunohost,dc=org",
57
+ "is_staff": "cn={{ app }}.staff,ou=permission,dc=yunohost,dc=org",
58
+ "is_superuser": "cn={{ app }}.superadmin,ou=permission,dc=yunohost,dc=org"
59
+ }
60
+ AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=permission,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE)
61
+ AUTH_LDAP_GROUP_TYPE = MemberDNGroupType("inheritPermission", "permissionYnh")
62
+ AUTH_LDAP_ALWAYS_UPDATE_USER = True
63
+ AUTH_LDAP_AUTHORIZE_ALL_USERS = False
64
+ AUTH_LDAP_FIND_GROUP_PERMS = True
65
+ AUTH_LDAP_CACHE_GROUPS = True
66
+ AUTH_LDAP_GROUP_CACHE_TIMEOUT = 1000
67
+ # import logging
68
+ # logger = logging.getLogger('django_auth_ldap')
69
+ # logger.addHandler(logging.StreamHandler())
70
+ # logger.setLevel(logging.DEBUG)
0 commit comments