Verified Commit 067c491f authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚜 feat(supann) Move CMS types to LDAP configuration

issue #6015
parent e9185c7e
...@@ -128,6 +128,37 @@ class supannConfig extends simplePlugin ...@@ -128,6 +128,37 @@ class supannConfig extends simplePlugin
[], [],
TRUE TRUE
), ),
new OrderedArrayAttribute(
new CharSeparatedCompositeAttribute(
_('Card types and their labels. Please prefix with {ORIGIN} for non standard types.'),
'fdSupannCMSTypes',
[
new StringAttribute(
_('Type'), _('Card type'),
'fdSupannCMSTypes_type', TRUE
),
new StringAttribute(
_('Label'), _('Label shown for this type'),
'fdSupannCMSTypes_label', TRUE
),
],
';',
'',
_('Card types')
),
FALSE,
[
'etudiant;étudiant',
'personnel;professionnelle',
'visiteur;visiteur, anonyme',
'invite;invité, nominative',
'lecteur;lecteur de bibliothèque',
'prestataire;prestataire de services',
'vehicule;véhicule',
'externe;externe',
],
TRUE
),
new SetAttribute( new SetAttribute(
new StringAttribute( new StringAttribute(
_('Card sources'), _('Multi service card possible sources, with format system@domain'), _('Card sources'), _('Multi service card possible sources, with format system@domain'),
......
# Nomenclature SupAnn
etudiant;étudiant
personnel;professionnelle
visiteur;visiteur, anonyme
invite;invité, nominative
lecteur;lecteur de bibliothèque
prestataire;prestataire de services
vehicule;véhicule
externe;externe
# Ajouter ici les types locaux étiquetés si besoin
# {ORIGINE}type_local;Type de carte défini localement par l'établissement ORIGINE
...@@ -52,6 +52,12 @@ attributetype ( 1.3.6.1.4.1.38414.17.1.8 NAME 'fdSupannCMSFormats' ...@@ -52,6 +52,12 @@ attributetype ( 1.3.6.1.4.1.38414.17.1.8 NAME 'fdSupannCMSFormats'
SUBSTR caseIgnoreSubstringsMatch SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.17.1.9 NAME 'fdSupannCMSTypes'
DESC 'FusionDirectory - SupAnn possible values for supannCMSType - format type;Label'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
# Object Class # Object Class
objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf' objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
DESC 'FusionDirectory SupAnn plugin configuration' DESC 'FusionDirectory SupAnn plugin configuration'
...@@ -60,5 +66,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf' ...@@ -60,5 +66,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
MAY ( MAY (
fdSupannStructuresRDN $ fdSupannPasswordRecovery $ fdSupannStructuresRDN $ fdSupannPasswordRecovery $
fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels $ fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels $
fdSupannCMSSources $ fdSupannCMSFormats $ fdSupannCMSAppDomains fdSupannCMSTypes $ fdSupannCMSSources $ fdSupannCMSFormats $ fdSupannCMSAppDomains
) ) ) )
...@@ -25,7 +25,13 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -25,7 +25,13 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
function __construct ($label, $description, $ldapName, $acl = '') function __construct ($label, $description, $ldapName, $acl = '')
{ {
global $config; global $config;
list($types, $typeLabels) = supann::get_choices_for('cmstype'); $types = [];
$typeLabels = [];
foreach ($config->get_cfg_value('SupannCMSTypes', []) as $supannCMSType) {
list($type, $label) = explode(';', $supannCMSType);
$types[] = $type;
$typeLabels[] = $label;
}
$formats = []; $formats = [];
$formatLabels = []; $formatLabels = [];
foreach ($config->get_cfg_value('SupannCMSFormats', ['MIFARE:XLSB;Mifare XLSB']) as $supannCMSFormat) { foreach ($config->get_cfg_value('SupannCMSFormats', ['MIFARE:XLSB;Mifare XLSB']) as $supannCMSFormat) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment