X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=gosa-core%2Fplugins%2Faddons%2FconfigViewer%2Fmigration%2Fclass_migrateRDN.inc;h=deefb0be5d9b64e7f429e01574b7ed44c3fd6453;hb=7cdfe86c50d0a25ffd0027dc4d26ee35ff422d34;hp=50ace96793c497379edb8fbfc5ef3cfb95a3871e;hpb=06262f1aabdd022c8efc406c9f76106fd468bfe5;p=gosa.git diff --git a/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc b/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc index 50ace9679..deefb0be5 100644 --- a/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc +++ b/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc @@ -9,12 +9,25 @@ class migrateRDN implements propertyMigration 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 getChanges() + { + return($this->found); + } + function checkForIssues() { $this->found = array(); @@ -24,8 +37,9 @@ class migrateRDN implements propertyMigration $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){ @@ -80,6 +94,7 @@ class migrateRDN implements propertyMigration $container = preg_replace("/^[^,]*+,/","",$container); } + $dnTo = $name.",".$targetValue.$container; if(!empty($targetValue) && !$ldap->dn_exists($targetValue.$container)){ $this->found['add'][$targetValue.$container] = array();