Code

Removed some unused attributes from workstartup
[gosa.git] / gosa-core / include / functions_FAI.inc
index 92a350e4dab9ca386ff4aa265565073dfd72c73c..b954d61fc76e44354218087d2121af89f96b4db2 100644 (file)
@@ -37,7 +37,8 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
     foreach($deps_to_search as $fai_base){
 
       /* Ldap search for fai classes specified in this release */
-      $res_tmp = get_list($filter,"fai",$fai_base,array("dn","objectClass","FAIstate"),GL_SUBSEARCH | GL_SIZELIMIT);
+      $attributes  = array("dn","objectClass","FAIstate","cn");
+      $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH | GL_SIZELIMIT);
   
       /* check the returned objects, and add/replace them in our return variable */
       foreach($res_tmp as $attr){
@@ -54,7 +55,6 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
           }
         }
 
-
         /* In detailed mode are some additonal informations visible */
         if($detailed){
 
@@ -67,8 +67,12 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
           }
 
           /* Append objectClass to resulsts */
-          $buffer['objectClass']  = $attr['objectClass'];
-          unset($buffer['objectClass'][0]);
+          foreach($attributes as $val){
+            if(isset($attr[$val])){
+              $buffer[$val] = $attr[$val];
+            }
+          }
+          unset($buffer['objectClass']['count']);
         }
 
         /* Add this object to our list */
@@ -151,8 +155,9 @@ function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = false)
       }
     } 
   }
-   
-  $_SESSION['FAI_objects_to_save'][$Current_DN] =  $addObj;
+  $FAI_objects_to_save = session::get('FAI_objects_to_save') ;
+  $FAI_objects_to_save[$Current_DN] =  $addObj;
+  session::set('FAI_objects_to_save',$FAI_objects_to_save);
 }
 
 
@@ -214,16 +219,18 @@ function save_release_changes_now()
   $to_save = array();
 
   /* check which objects must be saved */
-  foreach($_SESSION['FAI_objects_to_save'] as $Current_DN => $object){
+  $FAI_objects_to_save = session::get('FAI_objects_to_save');
+  foreach($FAI_objects_to_save as $Current_DN => $object){
     if($object['diff']){
       $sub_name = $Current_DN;
-      while(isset($_SESSION['FAI_objects_to_save'][$sub_name])){
-        $to_save[strlen($sub_name)][$sub_name] = $_SESSION['FAI_objects_to_save'][$sub_name]; 
-        unset($_SESSION['FAI_objects_to_save'][$sub_name]);
+      while(isset($FAI_objects_to_save[$sub_name])){
+        $to_save[strlen($sub_name)][$sub_name] = $FAI_objects_to_save[$sub_name]; 
+        unset($FAI_objects_to_save[$sub_name]);
         $sub_name = preg_replace('/^[^,]+,/', '', $sub_name);
       }
     }
   }
+  session::set('FAI_objects_to_save',$FAI_objects_to_save);
 
   /* Sort list of objects that must be saved, and ensure that 
       container   objects are safed, before their childs are saved */
@@ -373,7 +380,7 @@ function save_release_changes_now()
         save_FAI_object($parent_obj,$objectAttrs);
 
         if(($parent_obj != $Current_DN)){
-          print_red(sprintf(_("Error, following objects should be equal '%s' and '%s'"),$parent_obj,$Current_DN));
+          msg_dialog::display(_("Error"), sprintf(_("Error, following objects should be equal '%s' and '%s'"),$parent_obj,$Current_DN), ERROR_DIALOG);
         }
       }
     }