Code

Updated Workstation Startup settings
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 25 Mar 2008 07:07:22 +0000 (07:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 25 Mar 2008 07:07:22 +0000 (07:07 +0000)
-Do not query SI server, if no si server is configured in the gosa.conf-iguration file.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9964 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 6f66628f259812f23ce1ee07b7ec09f637965d06..f8b151bebe47e93e90c7586ec96577f84a05a99b 100644 (file)
@@ -37,6 +37,7 @@ class workstartup extends plugin
   var $FAIclass           = array();  // The currently selected classes 
   var $FAIrelease         = "";
   var $FAIdebianMirror    = "auto";
+  var $si_active            = FALSE;
   var $si_fai_action_failed = FALSE;
 
   var $cache              = array(); // Used as cache in fai mehtods
@@ -69,6 +70,9 @@ class workstartup extends plugin
 
     plugin::plugin ($config, $dn, $parent);
 
+    /* Check for si daemon */
+    $this->si_active = isset($this->config->current['GOSA_SI']) && !empty($this->config->current['GOSA_SI']);
+
     /* Check object group membership */
     if(!isset($this->parent->by_object['ogroup'])){
       $ldap = $this->config->get_ldap_link();
@@ -229,7 +233,7 @@ class workstartup extends plugin
     }
 
 
-    if($this->fai_activated && !$this->si_fai_action_failed){
+    if($this->fai_activated && !$this->si_fai_action_failed && $this->si_active){
 
       /* Check if the current mirror is available 
        */
@@ -609,11 +613,11 @@ class workstartup extends plugin
 
     /* Create FAI output */
     $this->update_fai_cache();
-    if($this->si_fai_action_failed){
-      $smarty->assign("si_fai_action_failed",$this->si_fai_action_failed);
-    }elseif($this->fai_activated){
+    $smarty->assign("si_fai_action_failed",$this->si_fai_action_failed);
+    $smarty->assign("si_active",$this->si_active);
+  
+    if(!$this->si_fai_action_failed && $this->si_active && $this->fai_activated){
 
-      $smarty->assign("si_fai_action_failed",$this->si_fai_action_failed);
       $smarty->assign("FAIservers"  , $this->cache['SERVERS']);
       $smarty->assign("FAIdebianMirror",$this->FAIdebianMirror);
       $smarty->assign("FAIrelease"  , $this->FAIrelease);
@@ -893,7 +897,7 @@ class workstartup extends plugin
 
 
     /* Skip FAI attribute handling if not necessary */
-    if($this->fai_activated && !$this->si_fai_action_failed){
+    if($this->fai_activated && !$this->si_fai_action_failed && $this->si_active){
       $ldap->cat($this->dn,array("FAIstate"));
       $checkFAIstate = $ldap->fetch();
 
@@ -1074,7 +1078,7 @@ class workstartup extends plugin
   {
     $force = FALSE;
     $this->si_fai_action_failed = FALSE;
-  
+    if(!$this->si_active) return; 
     $start = microtime(TRUE);  
 
     /* Get the list of available servers and their releases. 
index 2523fae7c15a803d3f89a14c79f50b446945260b..73d0a2f639ce682cd607fd889179a4317380ad4d 100644 (file)
   
   <td style="vertical-align:top;">
 
-       {if $si_fai_action_failed}
+       {if !$si_active}
+               <b>{t}GOsa support daemon not configured{/t}</b><br>
+               {t}FAI settings cannot be modified{/t}
+       {elseif $si_fai_action_failed}
                <b>{msgPool type=siError}</b><br>
                {t}Check if the GOsa support daemon (gosa-si) is running.{/t}
        {elseif $fai_activated}