Verified Commit 0fe7ea6b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

feat(supann) Add resources to configuration for supannRessourceEtatDate

issue #5907
parent 11a6aa4f
......@@ -60,6 +60,28 @@ class supannConfig extends simplePlugin
'fdSupannPasswordRecovery', FALSE,
TRUE
),
new OrderedArrayAttribute(
new CharSeparatedCompositeAttribute(
_('Custom resources and their labels'),
'fdSupannRessourceLabels',
[
new StringAttribute(
_('Resource'), _('String that will be stored between {} in supannRessourceEtatDate'),
'fdSupannRessourceLabels_resource', TRUE
),
new StringAttribute(
_('Label'), _('Label shown for this resource'),
'fdSupannRessourceLabels_label', TRUE
),
],
':',
'',
_('Custom resources')
),
FALSE,
[],
TRUE
),
new OrderedArrayAttribute(
new CharSeparatedCompositeAttribute(
_('Allowed substates for an account'),
......
......@@ -17,13 +17,19 @@ attributetype ( 1.3.6.1.4.1.38414.17.1.2 NAME 'fdSupannPasswordRecovery'
SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.38414.17.1.3 NAME 'fdSupannRessourceSubStates'
DESC 'FusionDirectory - SupAnn supannRessourceEtatDate allowed substates'
DESC 'FusionDirectory - SupAnn supannRessourceEtatDate allowed substates - format state:substate'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26)
attributetype ( 1.3.6.1.4.1.38414.17.1.4 NAME 'fdSupannRessourceSubStatesLabels'
DESC 'FusionDirectory - SupAnn labels for custom supannRessourceEtatDate substates'
DESC 'FusionDirectory - SupAnn labels for custom supannRessourceEtatDate substates - format substate:label'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.17.1.5 NAME 'fdSupannRessourceLabels'
DESC 'FusionDirectory - SupAnn custom resources for supannRessourceEtatDate - format resource:label'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
......@@ -35,5 +41,5 @@ objectclass ( 1.3.6.1.4.1.38414.17.2.1 NAME 'fdSupannPluginConf'
MUST ( cn )
MAY (
fdSupannStructuresRDN $ fdSupannPasswordRecovery $
fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels
fdSupannRessourceSubStates $ fdSupannRessourceSubStatesLabels $ fdSupannRessourceLabels
) )
......@@ -108,6 +108,16 @@ class supannAccountStatus extends simplePlugin implements UserTabLockingAction
$this->substatus = static::getConfiguredSubstates();
$resources = ['COMPTE' => _('Account'),'MAIL' => _('Mail')];
foreach ($config->get_cfg_value('SupannRessourceLabels', []) as $line) {
list($resource,$label) = explode(':', $line, 2);
$resources[$resource] = $label;
}
$this->attributesAccess['supannRessourceEtatDate']->attribute->attributes[0]->setChoices(
array_keys($resources),
array_values($resources)
);
$this->attributesAccess['supannRessourceEtatDate']->setLinearRendering(FALSE);
$this->attributesAccess['supannRessourceEtatDate']->setRequired(TRUE);
$this->attributesAccess['supannRessourceEtatDate']->setHeaders([
......
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