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

:ambulance: fix(ppolicy) Store dn instead of cn for default ppolicy

Also attempt at migrating previous configuration
Code in core will need to be adapted.

issue #6044
Showing with 26 additions and 4 deletions
+26 -4
...@@ -47,12 +47,26 @@ class ppolicyConfig extends simplePlugin ...@@ -47,12 +47,26 @@ class ppolicyConfig extends simplePlugin
'ou=ppolicies' 'ou=ppolicies'
), ),
new StringAttribute( new StringAttribute(
_('Default ppolicy cn'), _('What you put as default ppolicy in the overlay config'), _('Default ppolicy dn'), _('What you put as default ppolicy in the overlay config'),
'fdPpolicyDefaultCn', FALSE, 'fdPpolicyDefaultDn', FALSE
'default'
), ),
new HiddenAttribute('fdPpolicyDefaultCn'),
] ]
], ],
]; ];
} }
function __construct (string $dn = NULL, $object = NULL, $parent = NULL, bool $mainTab = FALSE)
{
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
if (!empty($this->fdPpolicyDefaultCn)) {
if (empty($this->fdPpolicyDefaultDn)) {
$this->fdPpolicyDefaultDn = 'cn='.$this->fdPpolicyDefaultCn.','.get_ou('ppolicyRDN').$config->current['BASE'];
}
$this->fdPpolicyDefaultCn = '';
}
}
} }
...@@ -11,15 +11,23 @@ attributetype ( 1.3.6.1.4.1.38414.45.1.1 NAME 'fdPpolicyRDN' ...@@ -11,15 +11,23 @@ attributetype ( 1.3.6.1.4.1.38414.45.1.1 NAME 'fdPpolicyRDN'
SINGLE-VALUE) SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.45.1.2 NAME 'fdPpolicyDefaultCn' attributetype ( 1.3.6.1.4.1.38414.45.1.2 NAME 'fdPpolicyDefaultCn'
OBSOLETE
DESC 'FusionDirectory - cn of the default ppolicy' DESC 'FusionDirectory - cn of the default ppolicy'
EQUALITY caseExactIA5Match EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE) SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.45.1.3 NAME 'fdPpolicyDefaultDn'
DESC 'FusionDirectory - dn of the default ppolicy'
EQUALITY distinguishedNameMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
SINGLE-VALUE)
# Object Class # Object Class
objectclass ( 1.3.6.1.4.1.38414.45.2.1 NAME 'fdPpolicyPluginConf' objectclass ( 1.3.6.1.4.1.38414.45.2.1 NAME 'fdPpolicyPluginConf'
DESC 'FusionDirectory ppolicy plugin configuration' DESC 'FusionDirectory ppolicy plugin configuration'
SUP top AUXILIARY SUP top AUXILIARY
MUST ( cn ) MUST ( cn )
MAY ( fdPpolicyRDN $ fdPpolicyDefaultCn) ) MAY ( fdPpolicyRDN $ fdPpolicyDefaultCn $ fdPpolicyDefaultDn ) )
Supports Markdown
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