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

🚑 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
parent 3580f7e5
......@@ -47,12 +47,26 @@ class ppolicyConfig extends simplePlugin
'ou=ppolicies'
),
new StringAttribute(
_('Default ppolicy cn'), _('What you put as default ppolicy in the overlay config'),
'fdPpolicyDefaultCn', FALSE,
'default'
_('Default ppolicy dn'), _('What you put as default ppolicy in the overlay config'),
'fdPpolicyDefaultDn', FALSE
),
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'
SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.45.1.2 NAME 'fdPpolicyDefaultCn'
OBSOLETE
DESC 'FusionDirectory - cn of the default ppolicy'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
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
objectclass ( 1.3.6.1.4.1.38414.45.2.1 NAME 'fdPpolicyPluginConf'
DESC 'FusionDirectory ppolicy plugin configuration'
SUP top AUXILIARY
MUST ( cn )
MAY ( fdPpolicyRDN $ fdPpolicyDefaultCn) )
MAY ( fdPpolicyRDN $ fdPpolicyDefaultCn $ fdPpolicyDefaultDn ) )
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