Code

Fixed duplicated requests for release/class/kernel in class workstation Startup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Jun 2008 09:15:52 +0000 (09:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Jun 2008 09:15:52 +0000 (09:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11275 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc

index ca7405270ecbbead9a054a22f426ce4fe903b446..8cc81a1b41be69d5ccca2f887a958151bc1071cc 100644 (file)
@@ -245,9 +245,8 @@ class workstartup extends plugin
         }
         $this->FAIdebianMirror = "auto";
         $this->FAIrelease = key($this->cache['SERVERS'][$this->FAIdebianMirror]);
-        $this->cache =array();
+        $this->cache['CLASSES'] = array();
         $this->update_fai_cache();
-        
       }
   
       /* Check if the current mirror is available 
@@ -258,7 +257,7 @@ class workstartup extends plugin
           msg_dialog::display(_("Error"), sprintf(_("FAI release '%s' is not available on mirror '%s' - setting to release '%s'!"), $this->FAIrelease, $this->FAIdebianMirror,$new_release), ERROR_DIALOG);
         }
         $this->FAIrelease = $new_release;
-        $this->cache =array();
+        $this->cache['CLASSES'] = array();
         $this->update_fai_cache();
       }
     }
@@ -1107,7 +1106,7 @@ class workstartup extends plugin
       }
 
       $o_queue = new gosaSupportDaemon();
-      $tmp = $o_queue->FAI_get_server(); 
+      $tmp = $o_queue->FAI_get_server();
       if($o_queue->is_error()){
         msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
         $this->si_fai_action_failed = TRUE;
@@ -1155,7 +1154,7 @@ class workstartup extends plugin
       $release = $this->FAIrelease;
     }
 
-    if($force || !isset($this->cache['CLASSES'][$release])){
+    if($force || !isset($this->cache['CLASSES'][$release]) && $release != ""){
 
       /* Get the list of available servers and their releases.
        */
@@ -1209,7 +1208,7 @@ class workstartup extends plugin
 
     /* Get list of available kernel for this release 
      */
-    if($force || !isset($this->cache['KERNELS'][$release])){
+    if($force || !isset($this->cache['KERNELS'][$release]) && $release != ""){
       $o_queue = new gosaSupportDaemon();
       $tmp = $o_queue->FAI_get_kernels($release);
       $this->cache['KERNELS'][$release] = array();
@@ -1220,8 +1219,8 @@ class workstartup extends plugin
         if(empty($kernel)) continue;
         $this->cache['KERNELS'][$release][$kernel]=$kernel;
       }
+      ksort($this->cache['KERNELS'][$release]);
     }
-    ksort($this->cache['KERNELS'][$release]);
   }