Code

Replaced prepare_to_save_FAI_object with fai_func::prepare_to_save_FAI_object
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 12:45:30 +0000 (12:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 12:45:30 +0000 (12:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8351 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/fai/class_faiHook.inc
gosa-core/plugins/admin/fai/class_faiPackage.inc
gosa-core/plugins/admin/fai/class_faiPartitionTable.inc
gosa-core/plugins/admin/fai/class_faiProfile.inc
gosa-core/plugins/admin/fai/class_faiScript.inc
gosa-core/plugins/admin/fai/class_faiTemplate.inc
gosa-core/plugins/admin/fai/class_faiVariable.inc
gosa-core/plugins/admin/fai/functions_FAI.inc

index 6aa43ba98b2c9382b683c6c5ef03ac8d8940a8fc..22da2e5a2f09d8d15e95cdf70df77d5b419a504d 100644 (file)
@@ -409,7 +409,7 @@ class faiHook extends plugin
       $use_dn = $this->dn;
     }
 
-    prepare_to_save_FAI_object($use_dn,array(),true);
+    fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
 
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
 
@@ -418,7 +418,7 @@ class faiHook extends plugin
       if($faifilter['branch'] == "main"){
         $use_dn = $obj['dn'];
       }
-      prepare_to_save_FAI_object($use_dn,array(),true);
+      fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
     }
     $this->handle_post_events("remove");    
   }
@@ -456,7 +456,7 @@ class faiHook extends plugin
 
     $ldap = $this->config->get_ldap_link();
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/hook with dn '%s' failed."),$this->dn));
 
     if($this->initially_was_account){
@@ -537,13 +537,13 @@ class faiHook extends plugin
       }
 
       if($obj['status'] == "delete"){
-        prepare_to_save_FAI_object($sub_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($sub_dn,array(),true);
         $this->handle_post_events("remove");
       }elseif($obj['status'] == "edited"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("add");
       }
       $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
index 3e4656b424a530512d89b47e9ecede175b0a8aa7..2e62249bbb10ca9cad5b4e631b5af3681b8cf9b3 100644 (file)
@@ -341,7 +341,7 @@ class faiPackage extends plugin
       $use_dn = $this->dn;
     }
 
-    prepare_to_save_FAI_object($use_dn,array(),true);
+    fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
 
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
 
@@ -352,7 +352,7 @@ class faiPackage extends plugin
         if($faifilter['branch'] == "main"){
           $use_dn = $obj['dn'];
         }
-        prepare_to_save_FAI_object($use_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
     $this->handle_post_events("remove");
@@ -492,7 +492,7 @@ class faiPackage extends plugin
       $this->attrs['FAIdebianSection'][] = $sec;
     }
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn));
     
     if($this->initially_was_account){
@@ -534,7 +534,7 @@ class faiPackage extends plugin
         }
 
         if(in_array($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){
-          prepare_to_save_FAI_object($pkgdn,$pkgattrs);
+          fai_func::prepare_to_save_FAI_object($pkgdn,$pkgattrs);
         }
   
         /* Handle tagging */
index 29d3c86c94988648e1d863cfb0da82c2a2e5bb8a..55827a6a42c287d06a530bac5ff3d93dbcaf0a89 100644 (file)
@@ -351,7 +351,7 @@ class faiPartitionTable extends plugin
       $use_dn = $this->dn;
     }
 
-    prepare_to_save_FAI_object($use_dn,array(),true);
+    fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
 
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);   
  
@@ -362,7 +362,7 @@ class faiPartitionTable extends plugin
       if($faifilter['branch'] == "main"){
         $use_dn = $disk_dn;
       }
-      prepare_to_save_FAI_object($use_dn,array(),true);
+      fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($disk['partitions'] as $key => $partition){    
      
@@ -371,7 +371,7 @@ class faiPartitionTable extends plugin
         if($faifilter['branch'] == "main"){
           $use_dn = $disk_dn;
         }
-        prepare_to_save_FAI_object($use_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
   }
@@ -414,7 +414,7 @@ class faiPartitionTable extends plugin
 
     $ldap = $this->config->get_ldap_link();
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/partition table with dn '%s' failed."),$this->dn));
 
     if($this->initially_was_account){
@@ -461,13 +461,13 @@ class faiPartitionTable extends plugin
       }
 
       if($disk['status'] == "delete"){
-        prepare_to_save_FAI_object($disk_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($disk_dn,array(),true);
         $this->handle_post_events("remove");
       }elseif($disk['status'] == "edited"){
-        prepare_to_save_FAI_object($disk_dn,$disk_attrs);
+        fai_func::prepare_to_save_FAI_object($disk_dn,$disk_attrs);
         $this->handle_post_events("modify");
       }elseif($disk['status']=="new"){
-        prepare_to_save_FAI_object($disk_dn,$disk_attrs);
+        fai_func::prepare_to_save_FAI_object($disk_dn,$disk_attrs);
         $this->handle_post_events("add");
       }
 
@@ -512,13 +512,13 @@ class faiPartitionTable extends plugin
         }
 
         if($partition['status'] == "delete"){
-          prepare_to_save_FAI_object($partition_dn,array(),true);
+          fai_func::prepare_to_save_FAI_object($partition_dn,array(),true);
           $this->handle_post_events("remove");
         }elseif($partition['status'] == "edited"){
-          prepare_to_save_FAI_object($partition_dn,$partition_attrs);
+          fai_func::prepare_to_save_FAI_object($partition_dn,$partition_attrs);
           $this->handle_post_events("modify");
         }elseif($partition['status']=="new"){
-          prepare_to_save_FAI_object($partition_dn,$partition_attrs);
+          fai_func::prepare_to_save_FAI_object($partition_dn,$partition_attrs);
           $this->handle_post_events("add");
         }
 
index fb6d1877e5bd54a93a50a389f0100784cbc80232..382f09bafd4af84dea1af5f74ddbfc4882bc31c1 100644 (file)
@@ -376,7 +376,7 @@ class faiProfile extends plugin
     }
 
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
-    prepare_to_save_FAI_object($use_dn,array(),true);
+    fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
     $this->handle_post_events("remove");    
   }
 
@@ -440,7 +440,7 @@ class faiProfile extends plugin
 
     $this->attrs['FAIclass']=trim($this->FAIclass);
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
    
     if($this->initially_was_account){
       new log("modify","fai/".get_class($this),$this->dn,$this->attributes);
index af71b587f3b1a0ddedd2d55000af1491cd9864af..3f3ba1fbdef2f9283648a3eae4b84dbc9273cc8c 100644 (file)
@@ -445,14 +445,14 @@ class faiScript extends plugin
    
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
  
-      prepare_to_save_FAI_object($use_dn,array(),true);
+      fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       
       foreach($this->SubObjects as $name => $obj){
         $use_dn = preg_replace("/".normalizePreg(fai_func::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']);
         if($faifilter['branch'] == "main"){
           $use_dn = $obj['dn'];
         }
-        prepare_to_save_FAI_object($use_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
     }
@@ -503,7 +503,7 @@ class faiScript extends plugin
 
     $ldap = $this->config->get_ldap_link();
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Creating of FAI/script with dn '%s' failed."),$this->dn));
 
     if($this->initially_was_account){
@@ -587,13 +587,13 @@ class faiScript extends plugin
       }
 
       if($obj['status'] == "delete"){
-        prepare_to_save_FAI_object($sub_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($sub_dn,array(),true);
         $this->handle_post_events("remove");
       }elseif($obj['status'] == "edited"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("add");
       }
 
index 831f0c42748608ec941010d8524f1c71805d7995..b3e24e86335a267f051dcd787c38e23645fe9071 100644 (file)
@@ -393,7 +393,7 @@ class faiTemplate extends plugin
       $use_dn = $this->dn;
     }
 
-    prepare_to_save_FAI_object($use_dn,array(),true);
+    fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
 
     foreach($this->SubObjects as $name => $obj){
@@ -401,7 +401,7 @@ class faiTemplate extends plugin
       if($faifilter['branch'] == "main"){
         $use_dn = $obj['dn'];
       }
-      prepare_to_save_FAI_object($use_dn,array(),true);
+      fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
     }
     $this->handle_post_events("remove");    
   }
@@ -434,7 +434,7 @@ class faiTemplate extends plugin
 
     $ldap = $this->config->get_ldap_link();
 
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/template with dn '%s' failed."),$this->dn));
 
     if($this->initially_was_account){
@@ -506,13 +506,13 @@ class faiTemplate extends plugin
       }
 
       if($obj['status'] == "delete"){
-        prepare_to_save_FAI_object($sub_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($sub_dn,array(),true);
         $this->handle_post_events("remove");
       }elseif($obj['status'] == "edited"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("add");
       }
 
index 24a5aed64f6e9aa61069ed52d8eb91a4d0c5bb3a..32f26c1b99733e387bf669a73d63b310616232ec 100644 (file)
@@ -290,7 +290,7 @@ class faiVariable extends plugin
         $use_dn = $this->dn;
       }
   
-      prepare_to_save_FAI_object($use_dn,array(),true);
+      fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
 
       foreach($this->SubObjects as $name => $obj){
@@ -298,7 +298,7 @@ class faiVariable extends plugin
         if($faifilter['branch'] == "main"){
           $use_dn = $obj['dn'];
         }
-        prepare_to_save_FAI_object($use_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
     }
@@ -336,7 +336,7 @@ class faiVariable extends plugin
     plugin::save();
  
     $ldap = $this->config->get_ldap_link();
-    prepare_to_save_FAI_object($this->dn,$this->attrs);
+    fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/variable with dn '%s' failed."),$this->dn));
 
     if($this->initially_was_account){
@@ -402,13 +402,13 @@ class faiVariable extends plugin
       }
       
       if($obj['status'] == "delete"){
-        prepare_to_save_FAI_object($sub_dn,array(),true);
+        fai_func::prepare_to_save_FAI_object($sub_dn,array(),true);
         $this->handle_post_events("remove");
       }elseif($obj['status'] == "edited"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        prepare_to_save_FAI_object($sub_dn,$tmp);
+        fai_func::prepare_to_save_FAI_object($sub_dn,$tmp);
         $this->handle_post_events("add");
       }
 
index 2fd161d578cbd0146d4b58af9dbb62b65510666e..822860a3e007a11df5fb5e904ccb9ffe531198e8 100644 (file)
@@ -3,8 +3,6 @@
 define("DEBUG_FAI_FUNC",FALSE);
 
 
-
-
 class fai_func
 {
 
@@ -14,7 +12,7 @@ class fai_func
      This function resolves the releases  
      from base up to the given dn.
    */
-static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
+  static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -92,7 +90,7 @@ static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = f
 
 
   /* Return all relevant FAI departments */
-static function get_FAI_departments($suffix = "")
+  static function get_FAI_departments($suffix = "")
   {
     $arr = array("hooks","scripts","disk","packages","profiles","templates","variables");
     $tmp = array();
@@ -111,7 +109,7 @@ static function get_FAI_departments($suffix = "")
 
 
   /* Return all releases within the given base */
-static function get_all_releases_from_base($dn,$appendedName=false)
+  static function get_all_releases_from_base($dn,$appendedName=false)
   {
     global $config;
 
@@ -137,7 +135,7 @@ static function get_all_releases_from_base($dn,$appendedName=false)
 
 
   /* Add this object to list of objects, that must be checked for release saving */
-static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = false)
+  static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = false)
   {
     /* Get ldap object */  
     global $config;
@@ -168,7 +166,7 @@ static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = f
 
 
   /* Detect differences in attribute arrays  */
-static function array_diff_FAI($ar1,$ar2)
+  static function array_diff_FAI($ar1,$ar2)
   {
 
     if((!isset($ar1['description'])) || (isset($ar1['description']) && (count($ar1['description']) == 0))){
@@ -203,7 +201,7 @@ static function array_diff_FAI($ar1,$ar2)
   }
 
 
-static function arr_diff($ar1,$ar2)
+  static function arr_diff($ar1,$ar2)
   {
     foreach($ar1 as $ak1 => $av1){
       if(!isset($ar2[$ak1]) || (!($av1 === $ar2[$ak1]))){
@@ -219,7 +217,7 @@ static function arr_diff($ar1,$ar2)
 
 
   /* check which objects must be saved, and save them */
-static function save_release_changes_now()
+  static function save_release_changes_now()
   {
     /* Variable init*/
     $to_save = array();
@@ -397,7 +395,7 @@ static function save_release_changes_now()
 
   /* this function will remove all unused (deleted) objects,
      that have no parent object */
-static function clean_up_releases($Current_DN)
+  static function clean_up_releases($Current_DN)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -452,7 +450,7 @@ static function clean_up_releases($Current_DN)
 
 
   /* Remove numeric index and 'count' from ldap->fetch result */
-static function prepare_ldap_fetch_to_be_saved($attrs)
+  static function prepare_ldap_fetch_to_be_saved($attrs)
   {
     foreach($attrs as $key => $value){
       if(is_numeric($key) || ($key == "count") || ($key == "dn")){
@@ -467,7 +465,7 @@ static function prepare_ldap_fetch_to_be_saved($attrs)
 
 
   /* Save given attrs to specified dn*/
-static function save_FAI_object($dn,$attrs)
+  static function save_FAI_object($dn,$attrs)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -498,7 +496,7 @@ static function save_FAI_object($dn,$attrs)
 
 
   /* Return FAIstate freeze branch or "" for specified release department */
-static function get_release_tag($dn)
+  static function get_release_tag($dn)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -520,7 +518,7 @@ static function get_release_tag($dn)
   }
 
 
-static function get_following_releases_that_inherit_this_object($dn)
+  static function get_following_releases_that_inherit_this_object($dn)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -556,7 +554,7 @@ static function get_following_releases_that_inherit_this_object($dn)
 
 
   /* Get previous version of the object dn */
-static function get_parent_release_object($dn,$include_myself=true)
+  static function get_parent_release_object($dn,$include_myself=true)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -593,7 +591,7 @@ static function get_parent_release_object($dn,$include_myself=true)
 
 
   /* return release names of all parent releases */
-static function get_previous_releases_of_this_release($dn,$flat)
+  static function get_previous_releases_of_this_release($dn,$flat)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -641,7 +639,7 @@ static function get_previous_releases_of_this_release($dn,$flat)
 
 
   /* This function returns all sub release names, recursivly  */
-static function get_sub_releases_of_this_release($dn,$flat = false)
+  static function get_sub_releases_of_this_release($dn,$flat = false)
   {
     global $config;
     $res  = array();
@@ -674,7 +672,7 @@ static function get_sub_releases_of_this_release($dn,$flat = false)
 
 
   /* Check if the given department is a release department */
-static function is_release_department($dn)
+  static function is_release_department($dn)
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -699,7 +697,7 @@ static function is_release_department($dn)
 
 
   /* This function returns the dn of the object release */
-static function get_release_dn($Current_DN)
+  static function get_release_dn($Current_DN)
   {
     global $config;
     $ldap = $config->get_ldap_link();