From: hickert Date: Thu, 14 Feb 2008 09:17:45 +0000 (+0000) Subject: Updated plugin::recursive_move X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a7450dc50ba1025b3f92be435eecfa2f0156fa1;p=gosa.git Updated plugin::recursive_move -Fixed duplicated recursion. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8900 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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); }