From 51eeb1fccd48a73359bc0125a48e81cef23d6ccf Mon Sep 17 00:00:00 2001 From: Josue Kouka Date: Thu, 11 Feb 2016 15:48:34 +0100 Subject: [PATCH] add Sezhame app settings (#9760) --- mandayejs/applications.py | 36 ++++++++++++++++++++++++++++- mandayejs/static/sezhame/js/auth.checker.js | 5 ++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 mandayejs/static/sezhame/js/auth.checker.js diff --git a/mandayejs/applications.py b/mandayejs/applications.py index 47c3fe0..7650ecd 100644 --- a/mandayejs/applications.py +++ b/mandayejs/applications.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from __future__ import unicode_literals + import os from importlib import import_module @@ -94,7 +96,7 @@ class Test(AppSettings): } ] SITE_AUTH_CHECKER = 'js/test/auth.checker.js' - SITE_AUTH_COOKIE_KEYS = [ 'test'] + SITE_AUTH_COOKIE_KEYS = ['test'] SITE_FORCE_REDIRECT_URL = '/whatever' @@ -267,7 +269,39 @@ class ImuseFamily(Imuse): SITE_LOGOUT_LOCATOR = '#MENU_FAMILLE_QUITTER' + class ImuseFamilyMontpellier(ImuseFamily): SITE_LOGIN_PATH_PREFIX = '/montpellier/' +class Sezhame(AppSettings): + SITE_LOGIN_PATH = '/sezhame/page/connexion-abonne?destination=user' + + SITE_LOCATORS = [ + { + 'id': '#edit-user', + 'label': 'Numero de cqrte', + 'name': 'edit-user', + 'kind': 'string', + 'required': True, + 'help': '' + }, + { + 'id': '#edit-password', + 'label': 'Mot de passe', + 'name': 'edit-password', + 'kind': 'password', + 'required': True, + 'help': '' + } + ] + + SITE_AUTH_CHECKER = 'sezhame/js/auth.checker.js' + + SITE_AUTH_COOKIE_KEYS = [ + 'SESSf36da25307ad6240a58ddd4f4b138952', + 'ASPSESSIONIDQSDRASTR' + ] + + SITE_FORCE_REDIRECT_LOCATOR = '#dk-opac15-login-form' + diff --git a/mandayejs/static/sezhame/js/auth.checker.js b/mandayejs/static/sezhame/js/auth.checker.js new file mode 100644 index 0000000..84d3d21 --- /dev/null +++ b/mandayejs/static/sezhame/js/auth.checker.js @@ -0,0 +1,5 @@ +window.auth_success = function(){ + if (location.href.indexOf('/sezhame/users/')) + return true; + return false; +} -- 2.7.0