Code

Backport from trunk
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiGroupHandle.inc
index 0049555ed00f209335c61918162e82523d3f36d0..095be052362b32859b9655137f2c2c7b929608a3 100644 (file)
@@ -10,7 +10,7 @@ class faiGroupHandle{
 
   public function __construct($FAI_group, $Action)
   {
-    if(in_array($Action,array("edit","remove","copy","cut"))){
+    if(in_array_strict($Action,array("edit","remove","copy","cut"))){
       $this->mode = $Action;
     }else{
       trigger_error("Wrong action type '".$Action."'.");
@@ -18,11 +18,13 @@ class faiGroupHandle{
     }
 
     /* Preset required values */
+    $select_set = FALSE;
     foreach($FAI_group as $type => $data){
       $FAI_group[$type]['selected'] = FALSE;
       $FAI_group[$type]['freezed'] = isset($data['FAIstate']) && preg_match("/freeze/",$data['FAIstate']);
-      if(($this->mode == "cut" || $this->mode == "edit") && !$FAI_group[$type]['freezed']){
+      if(!$select_set && ($this->mode == "cut" || $this->mode == "edit") && !$FAI_group[$type]['freezed']){
         $FAI_group[$type]['selected'] = TRUE;
+        $select_set =TRUE;
       }
     }
     $this->FAI_group = $FAI_group;
@@ -40,7 +42,7 @@ class faiGroupHandle{
   function save_object()
   {
     if(isset($_POST['faiGroupHandle'])){
-      if(in_array($this->mode,array("copy","cut","remove"))){
+      if(in_array_strict($this->mode,array("copy","cut","remove"))){
         foreach($this->FAI_group as $key => $group){
           if(isset($_POST[$this->mode."_".$key])){
             $this->FAI_group[$key]['selected'] = TRUE;
@@ -109,9 +111,9 @@ class faiGroupHandle{
         "FAItemplate"        => array("IMG"=> "plugins/fai/images/fai_template.png",
           "NAME"=>_("Templates") ,     "KZL"=> "T",  "VAR"=>"ShowTemplates"),
         "opsi_netboot"       => array("IMG"=> "plugins/opsi/images/netboot_package.png",
-          "NAME"=>_("OPSI netboot product") ,     "KZL"=> "ON",  "VAR"=>"ShowOpsiNetboot"),
+          "NAME"=>_("OPSI net boot product") ,     "KZL"=> "ON",  "VAR"=>"ShowOpsiNetboot"),
         "opsi_local"         => array("IMG"=> "plugins/opsi/images/local_package.png",
-          "NAME"=>_("OPSI local product")   ,     "KZL"=> "OL",  "VAR"=>"ShowOpsiLocal"));
+          "NAME"=>_("OPSI local boot product")   ,     "KZL"=> "OL",  "VAR"=>"ShowOpsiLocal"));
     return($objects);
   }
 }