From 79caee95e3702ffe3775db663123257cb1e3a60b Mon Sep 17 00:00:00 2001 From: Josue Kouka Date: Wed, 3 Feb 2016 15:39:47 +0100 Subject: [PATCH] imuse app settings (#9833) --- mandayejs/applications.py | 55 ++++++++++++++++++++++++++++--- mandayejs/static/imuse/js/auth.checker.js | 8 +++++ 2 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 mandayejs/static/imuse/js/auth.checker.js diff --git a/mandayejs/applications.py b/mandayejs/applications.py index a64e3fa..72cc369 100644 --- a/mandayejs/applications.py +++ b/mandayejs/applications.py @@ -72,6 +72,7 @@ class AppSettingsMeta(type): class AppSettings(object): __metaclass__ = AppSettingsMeta + # Test App Settings class Test(AppSettings): SITE_LOGIN_PATH = '/' @@ -93,12 +94,13 @@ class Test(AppSettings): SITE_AUTH_COOKIE_KEYS = [ 'test'] SITE_FORCE_REDIRECT_URL = '/whatever' + # Duonet App Settings class Duonet(AppSettings): SITE_LOGIN_PATH = '/' SITE_LOCATORS = [ { - 'id': '#txtNomFoyer', + 'id': '#txtNomFoyer', 'label': 'Nom de famille', 'name': 'txtNomFoyer', 'kind': 'string', @@ -132,12 +134,15 @@ class Duonet(AppSettings): SITE_FORCE_REDIRECT_URL = '/Connect.aspx' + SITE_FORM_SUBMIT_ELEMENT = 'input[type=button]' + + # Archimed App Settings class Archimed(AppSettings): SITE_LOGIN_PATH = '/' SITE_LOCATORS = [ { - 'id': '#carte', + 'id': '#carte', 'label': 'Identifiant', 'name': 'carte', 'kind': 'string', @@ -170,8 +175,8 @@ class Archimed(AppSettings): urlpatterns = patterns('', url( - r'account/(?P[\w+]*)/$', - 'mandayejs.views.archimed_account_details', + r'account/(?P[\w+]*)/$', + 'mandayejs.views.archimed_account_details', name='archimed-account-details'), ) @@ -211,3 +216,45 @@ class Arpege(AppSettings): class ArpegeVincennesTest(Arpege): SITE_LOGIN_PATH = '/vincennes-test/index.do' + + +class Imuse(AppSettings): + SITE_LOGIN_PATH = 'extranet/login/gen_index_groupe.php?nav=autre' + + SITE_LOCATORS = [ + { + 'id': '#INDEX_USER_ID', + 'label': 'Identifiant', + 'name': 'INDEX_USER_ID', + 'kind': 'string', + 'required': True, + 'help': '' + }, + { + 'id': '#INDEX_USER_PWD', + 'label': 'Mot de passe', + 'name': 'INDEX_USER_PWD', + 'kind': 'password', + 'required': True, + 'help': '' + } + ] + + SITE_AUTH_CHECKER = 'imuse/js/auth.checker.js' + + SITE_AUTH_COOKIE_KEYS = [ + 'iMuse-extranet' + ] + + SITE_FORCE_REDIRECT_LOCATOR = '#INDEX_TBL_LOGIN' + + SITE_FORM_SUBMIT_ELEMENT = '#INDEX_BT_LOGIN' + + +class ImuseTeacherMontpellier(Imuse): + SITE_LOGIN_PATH = '/montpellier/extranet/login/ens_index_enseignant.php' + + +class ImuseFamilyMontpellier(Imuse): + SITE_LOGIN_PATH = '/montpellier/extranet/login/usa_index_famille.php' + diff --git a/mandayejs/static/imuse/js/auth.checker.js b/mandayejs/static/imuse/js/auth.checker.js new file mode 100644 index 0000000..f1453f7 --- /dev/null +++ b/mandayejs/static/imuse/js/auth.checker.js @@ -0,0 +1,8 @@ +$(function(){ + window.auth_success = function(){ + if ($('#INDEX_TBL_LOGIN').length < 1) + return true; + return false; + } +}) + -- 2.7.0