From 25d8d7e889c0bdf4e77157b57aa54b1c261765aa Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 12 May 2010 13:26:29 +0000 Subject: [PATCH] Updated migration of userRDN git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18384 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_migrate_userRDN.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/class_migrate_userRDN.inc b/gosa-core/include/class_migrate_userRDN.inc index 169039784..51e9694d5 100644 --- a/gosa-core/include/class_migrate_userRDN.inc +++ b/gosa-core/include/class_migrate_userRDN.inc @@ -72,10 +72,16 @@ class migrate_userRDN implements propertyMigration list($name, $container) = preg_split("/,/",$dn,2); if(preg_match("/^".preg_quote($initialValue,'/i')."/", $container)){ - $containerDN = preg_replace("/^".preg_quote($initialValue,'/')."/",$targetValue,$container); - $dnTo = $name.",".$containerDN; + $container = preg_replace("/^".preg_quote($initialValue,'/')."/",$targetValue,$container); + + // Ensure that we handle a valid gosaDepartment container. + while(!isset($this->config->idepartments[$container])){ + $container = preg_replace("/^[^,]*+,/","",$container); + } + + $dnTo = $name.",".$targetValue.$container; if(!empty($targetValue) && !$ldap->dn_exists($targetValue.$container)){ - $this->found['add'][$containerDN] = array(); + $this->found['add'][$targetValue.$container] = array(); } if($dn != $dnTo){ $this->found['move'][$dn] = $dnTo; -- 2.30.2