Code

Keep selected classes in case of an error.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Oct 2006 10:20:15 +0000 (10:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Oct 2006 10:20:15 +0000 (10:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4896 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc

index 812a48982592ef4df973562f09cbee2308fc918d..3d4d1300dbe8a2c6d3fff8f8c13efbf8f4539f2d 100644 (file)
@@ -42,6 +42,7 @@ class workstartup extends plugin
   var $FAIrelease         = "";
   var $FAIdebianMirror    = "auto";
 
+  var $unresolved_classes = array();
   
   /* FAI class selection */
   var $InheritedFAIclass           = array();
@@ -682,6 +683,7 @@ class workstartup extends plugin
     }
 
     $smarty->assign("FAIdebianMirrors",$this->getFAIdebianMirrors());
+    $smarty->assign("FAIdebianMirror",$this->FAIdebianMirror);
     $smarty->assign("FAIreleases",$this->getFAIreleases());
     $smarty->assign("FAIrelease",$this->FAIrelease);
     $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
@@ -706,6 +708,11 @@ class workstartup extends plugin
 
     foreach($tmp as $class){
 
+      $marker = "";
+      if(in_array_ics($class,$this->unresolved_classes)){
+        $marker = "&nbsp;<font color='red'>("._("Not available in current setup").")</font>";
+      }
+
       if($this->FAIdebianMirror == "inherited"){
         $str = "";
       }else{
@@ -720,7 +727,7 @@ class workstartup extends plugin
       $i ++ ; 
 
       $div->AddEntry(array(
-            array("string"=>$class),
+            array("string"=>$class.$marker),
             array("string"=>preg_replace("/\%s/",base64_encode($class),$str),"attach"=>"style='width:50px;border-right:none;'")
             ));
     }  
@@ -864,8 +871,10 @@ class workstartup extends plugin
         $eClasses .= $class." ";
       }
       
-      $this->FAIclass= array();
-      print_red(sprintf(_("Can't resolve the given FAIclass(es) [%s] anyway, please check your FAI configurations, possibly some classes where deleted or renamed. !All classes have been removed from this account, press cancel if you don't want this to be saved."),$eClasses));
+      $this->unresolved_classes = $errorClasses;
+      $this->FAIdebianMirror = "auto";
+      //$this->FAIclass= array();
+      print_red(sprintf(_("Can't resolve the given FAIclass(es) [%s] anyway, please check your FAI configurations, possibly some classes where deleted or renamed. Server was reset to 'auto'."),$eClasses));
     }
     return($ret);
   }