Code

Apply fix for #4177
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 4 Mar 2010 13:56:15 +0000 (13:56 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 4 Mar 2010 13:56:15 +0000 (13:56 +0000)
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

trunk/gosa-plugins/fai/admin/fai/class_faiHook.inc
trunk/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
trunk/gosa-plugins/fai/admin/fai/class_faiScript.inc
trunk/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
trunk/gosa-plugins/fai/admin/fai/class_faiVariable.inc

index 281b3d6becb09cefa6f5e8447730756398bfd883..5939f7eaa0e88875a4e45799153f70b4024ae914 100644 (file)
@@ -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'];
index 596e4ba0e3394c04f8849b3a26440e30bffcd2c8..07f4ab386798af451d243afc8c6f886daea2af88 100644 (file)
@@ -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'];
index b2a253e932bbcc0ad1ec42d97faaccc00563562a..278f068d11e7cf4959f3a23d22707b0a5c8db635 100644 (file)
@@ -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'];
index 689d5464bfa856d6dc395d5a5d2cf95af2ca92a3..b507268f416d1b608ee372a98ea5741e2d21aac1 100644 (file)
@@ -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'];
index 372dac4dd8aeae457b5484ef46543670df07247f..45f45832616e9357bdac88f958ca66bc126a1fa5 100644 (file)
@@ -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'];