From: hickert Date: Fri, 14 May 2010 08:29:00 +0000 (+0000) Subject: Added prefix for RDN migration X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c880f89a91e6789cc457681aa2e4927d3d0779d;p=gosa.git Added prefix for RDN migration git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18470 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc b/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc index 50ace9679..046b3ef59 100644 --- a/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc +++ b/gosa-core/plugins/addons/configViewer/migration/class_migrateRDN.inc @@ -9,6 +9,14 @@ 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; @@ -24,8 +32,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 +89,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();