diff --git a/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc b/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc
index 50ace96793c497379edb8fbfc5ef3cfb95a3871e..deefb0be5d9b64e7f429e01574b7ed44c3fd6453 100644 (file)
protected $found = array();
protected $filter ="";
protected $found = array();
protected $filter ="";
+ // Additional suffixes or prefixes
+ // e.g. for 'faiScriptRDN' (ou=scripts,) moving to new destination lets say
+ // to 'ou=FAIscripts,' would break stuff with having 'ou=fai,ou=systems,ou=config'
+ // prepended.
+ //
+ protected $suffix = "";
+ protected $prefix = "";
+
function __construct($config,$property)
{
$this->property = &$property;
$this->config = &$config;
}
function __construct($config,$property)
{
$this->property = &$property;
$this->config = &$config;
}
+ function getChanges()
+ {
+ return($this->found);
+ }
+
function checkForIssues()
{
$this->found = array();
function checkForIssues()
{
$this->found = array();
$ldap2->cd($this->config->current['BASE']);
// If the userRDN wasn't empty, then only search for users inside of the old userRDN.
$ldap2->cd($this->config->current['BASE']);
// If the userRDN wasn't empty, then only search for users inside of the old userRDN.
- $initialValue = $this->property->getValue();
- $targetValue = $this->property->getValue(TRUE);
+ $initialValue = $this->prefix.$this->property->getValue().$this->suffix;
+ $targetValue = $this->prefix.$this->property->getValue(TRUE).$this->suffix;
+
$dnMatch = "";
if(!empty($initialValue)){
foreach(preg_split("/,/", $initialValue) as $rdnPart){
$dnMatch = "";
if(!empty($initialValue)){
foreach(preg_split("/,/", $initialValue) as $rdnPart){
$container = preg_replace("/^[^,]*+,/","",$container);
}
$container = preg_replace("/^[^,]*+,/","",$container);
}
+
$dnTo = $name.",".$targetValue.$container;
if(!empty($targetValue) && !$ldap->dn_exists($targetValue.$container)){
$this->found['add'][$targetValue.$container] = array();
$dnTo = $name.",".$targetValue.$container;
if(!empty($targetValue) && !$ldap->dn_exists($targetValue.$container)){
$this->found['add'][$targetValue.$container] = array();