Code

Udpated Tag handling for FAI objects.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Dec 2007 09:20:58 +0000 (09:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Dec 2007 09:20:58 +0000 (09:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8064 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_CopyPasteHandler.inc
plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiPackage.inc
plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiProfile.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/class_faiVariable.inc

index aba5e3208a3e1976722044ce7c416f4f8b51b2f1..e09e6926bd4d212f112086cd148be70b8a708981 100644 (file)
@@ -67,6 +67,20 @@ class CopyPasteHandler {
         }
       }
     }
+
+    /* Ensure that UnitTags will be kept when pasted */
+    if(isset($obj->gosaUnitTag) && !empty($obj->gosaUnitTag)){
+      foreach($this->current->by_object as $name => $obj){
+        if(!in_array("gosaAdministrativeUnitTag",$this->current->by_object[$name]->objectclasses)){
+          $this->current->by_object[$name]->objectclasses[] = "gosaAdministrativeUnitTag";
+          $this->current->by_object[$name]->gosaUnitTag = $obj->gosaUnitTag;
+          if(!in_array("gosaUnitTag",$this->current->by_object[$name]->attributes)){
+            $this->current->by_object[$name]->attributes[] =  "gosaUnitTag";
+          }
+        }
+      }
+    }
+
     if($this->isCurrentObjectPastAble()){
       return(true);
     }else{
index 0ad7dba9e40936965dea554b0fca6810835db848..3c56f2cdbdb5abdcbdb127d392def07f6ef86031 100644 (file)
@@ -433,7 +433,7 @@ class faiHook extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI hook base failed")); 
 
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
 
     $ldap->cd($this->dn);
 
index 32a26f91bb1bca327d91c72be94b119ca651a50d..36ad4e38e99b1361b9195ea9622393a7120173c0 100644 (file)
@@ -508,7 +508,7 @@ class faiPackage extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI package base failed"));
 
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
     $ldap->cd($this->dn);
 
     /* Save Package configurations */
index c85cf9ab33e11f49997054cfe9e286efffb82a78..dfcc7a0e82f89375142c230d03271953966a229c 100644 (file)
@@ -368,7 +368,7 @@ class faiPartitionTable extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI partition table base failed"));
   
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
   
     /* Sort entries, because we must delete entries with status="delete" first */
     $order = array();
index 84e5b40b1174dc503303d66235f18985c104ea0c..62c13adf9d9b177bd00fa6498d6b2212f5ec6d6f 100644 (file)
@@ -459,7 +459,7 @@ class faiProfile extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI profile failed"));
 
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
     show_ldap_error($ldap->get_error());
   }
 
index ac945d890fedffa402ae1542b5017aa9546b303a..5bfe27019d3021465980e8a783a6446d85c63287 100644 (file)
@@ -465,7 +465,7 @@ class faiScript extends plugin
     show_ldap_error($ldap->get_error(), _("Creating FAI script base failed"));
 
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn, $this->gosaUnitTag);
 
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.
index bb552443cfa8a9690ec4711ccc25f151abc6d5e8..b04e07fc160cb69e4315f2611c95decf78027831 100644 (file)
@@ -403,7 +403,7 @@ class faiTemplate extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI template base failed"));
 
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
 
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.
index 171ad312d99130b3a8d5beb0ca07efbd7d3adb0f..19622f165d29264fd548aae2cce45932c6a8f2d2 100644 (file)
@@ -315,7 +315,7 @@ class faiVariable extends plugin
     show_ldap_error($ldap->get_error(), _("Saving FAI variable base failed"));
  
     /* Do object tagging */
-    $this->handle_object_tagging();
+    $this->handle_object_tagging($this->dn,$this->gosaUnitTag);
  
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.