From: psc Date: Thu, 4 Mar 2010 13:56:15 +0000 (+0000) Subject: Apply fix for #4177 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8e494bd7c78e83b30807f6c0e00e70580783c639;p=gosa.git Apply fix for #4177 When preparing objects for copy and paste use get_leaf_objects to get the list of leaf objects straight. Otherwise copied objects do not contain all classes they should contain. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@16072 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiHook.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiHook.inc index 281b3d6be..5939f7eaa 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -525,12 +525,8 @@ class faiHook extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], $this->subClass, get_ou('faiHookRDN')); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".preg_quote($source['dn'], '/')."$/i",$obj['dn'])) continue; - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn']; diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 596e4ba0e..07f4ab386 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -493,12 +493,8 @@ class faiPartitionTable extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=FAIpartitionDisk))"); + $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], "FAIpartitionDisk", get_ou('faiPartitionRDN')); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".preg_quote($source['dn'], '/')."$/i",$obj['dn'])) continue; - $objects = array(); $objects['description'] = ""; $objects['status'] = "edited"; @@ -511,12 +507,8 @@ class faiPartitionTable extends plugin /* read all partitions for each disk */ foreach($this->disks as $name => $disk){ - $res = FAI::get_all_objects_for_given_base($disk['dn'],"(&(objectClass=FAIclass)(objectClass=FAIpartitionEntry))"); + $res = FAI::get_leaf_objects($disk['dn'], $name, "FAIpartitionEntry", "cn=".$source['cn'][0].",".get_ou('faiPartitionRDN')); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".preg_quote($disk['dn'], '/')."$/i",$obj['dn'])) continue; - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn']; diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiScript.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiScript.inc index b2a253e93..278f068d1 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -582,12 +582,8 @@ class faiScript extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], $this->subClass, get_ou('faiScriptRDN')); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".preg_quote($source['dn'], '/')."$/i",$obj['dn'])) continue; - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn']; diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index 689d5464b..b507268f4 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -510,12 +510,8 @@ class faiTemplate extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], $this->subClass, get_ou('faiTemplateRDN')); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".preg_quote($source['dn'], '/')."$/i",$obj['dn'])) continue; - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn']; diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiVariable.inc index 372dac4dd..45f458326 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -371,9 +371,8 @@ class faiVariable extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_object($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + $res = FAI::get_leaf_objects($source['dn'], $source['cn'][0], $this->subClass, get_ou('faiVariableRDN')); foreach($res as $obj){ - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn'];