1.11
[auf_django_saml.git] / auf / django / saml / monkey.py
1 # -*- coding: utf-8 -*-
2
3 """
4 Setup automatique de LOGIN_URL et LOGOUT_URL
5 si SAML_AUTO_AUTH_URLS est positionné à True
6 """
7
8 import django
9 from django.conf import settings
10 import settings as saml_settings
11
12
13 if saml_settings.SAML_AUTO_AUTH_URLS:
14 if saml_settings.SAML_AUTH:
15 LOGIN_URL = '/mellon/login'
16 LOGOUT_URL = '/logout'
17 else:
18 LOGIN_URL = '/sandbox/login'
19 LOGOUT_URL = '/sandbox/logout'
20
21 django.contrib.auth.REDIRECT_FIELD_NAME = saml_settings.SAML_REDIRECT_FIELD_NAME
22 settings.LOGIN_URL = LOGIN_URL
23 settings.LOGOUT_URL = LOGOUT_URL