From 3a7450dc50ba1025b3f92be435eecfa2f0156fa1 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 14 Feb 2008 09:17:45 +0000 Subject: [PATCH] Updated plugin::recursive_move -Fixed duplicated recursion. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8900 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_plugin.inc | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index e33b2ec61..3527494d8 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -892,31 +892,11 @@ class plugin return (FALSE); } - /* Perform a search for all objects to be moved */ - $objects= array(); - $ldap->cd($src_dn); - $ldap->search("(objectClass=*)", array("dn")); - while($attrs= $ldap->fetch()){ - $dn= $attrs['dn']; - $objects[$dn]= strlen($dn); - } - - /* Sort objects by indent level */ - asort($objects); - reset($objects); - - /* Copy objects from small to big indent levels by replacing src_dn by dst_dn */ - foreach ($objects as $object => $len){ - $src= $object; - $dst= preg_replace("/$src_dn$/", "$dst_dn", $object); - if (!$this->copy($src, $dst)){ - return (FALSE); - } - } + $this->copy($src_dn, $dst_dn); /* Remove src_dn */ $ldap->cd($src_dn); - $ldap->recursive_remove(); + $ldap->recursive_remove($src_dn); return (TRUE); } -- 2.30.2