diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm index 6c9885926..2e427bf94 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm @@ -102,7 +102,7 @@ sub unserialize { # Manage hashes if ( $k =~ -/^(?:exportedVars|locationRules|groups|exportedHeaders|macros|globalStorageOptions|remoteGlobalStorageOptions|notificationStorageOptions|samlIDPMetaDataXML|samlIDPMetaDataExportedAttributes|samlIDPMetaDataOptions|samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions|samlStorageOptions|CAS_proxiedServices|logoutServices|authChoiceModules)$/ +/^(?:exportedVars|locationRules|groups|exportedHeaders|macros|globalStorageOptions|remoteGlobalStorageOptions|notificationStorageOptions|samlIDPMetaDataXML|samlIDPMetaDataExportedAttributes|samlIDPMetaDataOptions|samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions|samlStorageOptions|CAS_proxiedServices|logoutServices|authChoiceModules|applicationList)$/ and $v ||= {} and not ref($v) ) { diff --git a/modules/lemonldap-ng-manager/example/skins/default/manager.js b/modules/lemonldap-ng-manager/example/skins/default/manager.js index e3dffae68..80a024482 100644 --- a/modules/lemonldap-ng-manager/example/skins/default/manager.js +++ b/modules/lemonldap-ng-manager/example/skins/default/manager.js @@ -286,6 +286,8 @@ function display(div,title) { $('#newsamlattributeb,#delsamlattributeb').hide(); $('#newsamlattributebr').hide(); $('#newchoicer,#newchoice,#delchoice').hide(); + $('#newcategoryr,#delcategory').hide(); + $('#newapplicationr,#delapplication').hide(); var height_cur=$('#buttons').height()+$('#edition').height()+$('#help').height(); var height_max=$('#menu').height(); if(height_cur > height_max || $('#help_content').is(':visible')==false){ @@ -1008,3 +1010,32 @@ function setlmauthchoice(id){ setlmdata(id,auth+'|'+user+'|'+password); } +/* Application list */ +function applicationListCategoryRoot(id){ + currentId=id; + display('default',''); + $('#newcategoryr').show(); +} + +function newCategoryR(){ + var name = prompt(text4newCategory,'mycategory'); + if(!name){return false;} + var newIdValue=newId(currentId); + simpleTreeCollection[0].addNode(newIdValue,name,function(d,s){ + $('>span',s).attr('onClick','applicationListCategory("'+newIdValue+'")').attr('name',name).attr('value','My Category').attr('id','text_'+newIdValue); + applicationListCategory(newIdValue); + }); + return false; +} + +function delCategory(){ + delKey(); +} +function applicationListCategory(id){ + currentId=id; + $('#applicationListCategoryKey').attr('value',lmtext(id)); + $('#applicationListCategoryName').attr('value',lmdata(id)); + display('applicationListCategory',lmtext(id)); + $('#delcategory,#newapplicationr').show(); +} + diff --git a/modules/lemonldap-ng-manager/example/skins/default/manager.tpl b/modules/lemonldap-ng-manager/example/skins/default/manager.tpl index d264a888b..db1f46c3a 100644 --- a/modules/lemonldap-ng-manager/example/skins/default/manager.tpl +++ b/modules/lemonldap-ng-manager/example/skins/default/manager.tpl @@ -31,6 +31,8 @@ var text4newGeneratedFile=''; var text4edit=''; var text4protect=''; + var text4newCategory=''; + var text4newApplication=''; //]]> @@ -147,6 +149,23 @@ + + + + + + + + + @@ -447,6 +466,24 @@ + + + diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm index 5f59a8edb..44699245c 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm @@ -232,29 +232,38 @@ sub struct { # PORTAL PARAMETERS portalParams => { - _nodes => [qw(portal n:portalModules n:portalCustomization)], + _nodes => [qw(portal n:portalMenu n:portalCustomization)], _help => 'portalParams', portal => 'text:/portal:portal:text', + portalMenu => { + _nodes => [qw(portalModules cn:applicationList)], portalModules => { _nodes => [ qw(portalDisplayLogout portalDisplayResetPassword portalDisplayChangePassword portalDisplayAppslist) ], portalDisplayLogout => 'text:/portalDisplayLogout', - portalDisplayResetPassword => - 'bool:/portalDisplayResetPassword', portalDisplayChangePassword => 'text:/portalDisplayChangePassword', portalDisplayAppslist => 'text:/portalDisplayAppslist', }, + applicationList => { + _nodes => [ +'hash:/applicationList:default:applicationListCategory' + ], + _js => 'applicationListCategoryRoot', + }, + }, portalCustomization => { _nodes => [ - qw(portalSkin portalAutocomplete portalRequireOldPassword portalUserAttr portalOpenLinkInNewWindow) + qw(portalSkin portalDisplayResetPassword portalAutocomplete portalRequireOldPassword portalUserAttr portalOpenLinkInNewWindow) ], portalSkin => 'text:/portalSkin:portalParams:skinSelect', + portalDisplayResetPassword => + 'bool:/portalDisplayResetPassword', portalAutocomplete => 'bool:/portalAutocomplete', portalRequireOldPassword => 'bool:/portalRequireOldPassword', @@ -1048,6 +1057,10 @@ sub testStruct { my $testNotDefined = { test => sub { 1 }, msgFail => 'Ok' }; return { + applicationList => { + keyTest => qr/^(\d*)?\w+$/, + keyMsgFail => 'Bad category ID', + }, mailFrom => $testNotDefined, trustedDomains => $testNotDefined, exportedAttr => $testNotDefined, diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm index 3523de0e5..9513bb138 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm @@ -66,6 +66,7 @@ sub en { advancedParams => 'Advanced parameters', apacheParams => 'Apache parameters', apacheAuthnLevel => 'Authentication level', + applicationList => 'Categories and applications', attributesAndMacros => 'Attributes and macros', authChoiceModules => 'Allowed modules', authChoiceParam => 'URL parameter', @@ -206,7 +207,8 @@ sub en { portalDisplayLogout => 'Logout', portalDisplayResetPassword => 'Reset password', portalForceAuthn => 'Force authentication', - portalModules => 'Modules', + portalMenu => 'Menu', + portalModules => 'Modules activation', portalOpenLinkInNewWindow => 'New window', portalParams => 'Portal', portalRequireOldPassword => 'Require old password', @@ -416,6 +418,7 @@ sub fr { advancedParams => 'Paramètres avancés', apacheParams => 'Paramètres Apache', apacheAuthnLevel => 'Niveau d\'authentification', + applicationList => 'Catégories et applications', attributesAndMacros => 'Attributs et macros', authChoiceModules => 'Modules autorisés', authChoiceParam => 'Parmètre de l\'URL', @@ -556,6 +559,7 @@ sub fr { portalDisplayLogout => 'Déconnexion', portalDisplayResetPassword => 'Réinitialisation de mot de passe', portalForceAuthn => 'Authentication forcée', + portalMenu => 'Menu', portalModules => 'Modules', portalOpenLinkInNewWindow => 'Nouvelle fenêtre', portalParams => 'Portail',