|
|
@ -1,7 +1,7 @@ |
|
|
|
import ldap |
|
|
|
import ldap |
|
|
|
|
|
|
|
|
|
|
|
from django_auth_ldap.config import ( |
|
|
|
from django_auth_ldap.config import ( |
|
|
|
LDAPSearch, LDAPSearchUnion, {{ mayan_ldap_group_type }} |
|
|
|
LDAPSearch, LDAPSearchUnion, LDAPGroupQuery, {{ mayan_ldap_group_type }} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
from mayan.settings.production import * |
|
|
|
from mayan.settings.production import * |
|
|
@ -60,11 +60,25 @@ AUTH_LDAP_GROUP_SEARCH = LDAPSearch( |
|
|
|
|
|
|
|
|
|
|
|
AUTH_LDAP_GROUP_TYPE = {{ mayan_ldap_group_type }}() |
|
|
|
AUTH_LDAP_GROUP_TYPE = {{ mayan_ldap_group_type }}() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AUTH_LDAP_USER_FLAGS_BY_GROUP = { |
|
|
|
|
|
|
|
{% for key in mayan_ldap_flags_by_group.keys() %} |
|
|
|
|
|
|
|
{% if mayan_ldap_flags_by_group[key] | length > 0 %} |
|
|
|
|
|
|
|
'{{ key }}': ( |
|
|
|
|
|
|
|
{% for group in mayan_ldap_flags_by_group[key] %} |
|
|
|
|
|
|
|
LDAPGroupQuery('{{ group }}') {{ '|' if not loop.last }} |
|
|
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = ( |
|
|
|
AUTHENTICATION_BACKENDS = ( |
|
|
|
'django_auth_ldap.backend.LDAPBackend', |
|
|
|
'django_auth_ldap.backend.LDAPBackend', |
|
|
|
'django.contrib.auth.backends.ModelBackend' |
|
|
|
'django.contrib.auth.backends.ModelBackend' |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AUTH_LDAP_MIRROR_GROUPS = True |
|
|
|
|
|
|
|
|
|
|
|
{% if mayan_auth_custom_conf is defined %} |
|
|
|
{% if mayan_auth_custom_conf is defined %} |
|
|
|
{{ mayan_auth_custom_conf }} |
|
|
|
{{ mayan_auth_custom_conf }} |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|