Code

Added checks for selected install and config management method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Oct 2010 14:07:32 +0000 (14:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Oct 2010 14:07:32 +0000 (14:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20064 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc

index def5bb658b1c33850d2cdf25a628885efa78d40b..d82b6520f61fb6cb66edf195146bdd6f85fb13d3 100644 (file)
@@ -129,6 +129,22 @@ class InstallRecipe extends plugin
             $this->installBootstrapMethod = key($this->installBootstrapMethodList);
             $this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
         }
+
+        // Check if we've a valid bootstrap and configMangement method selected
+        if(!isset($this->installConfigManagementList[$this->installBootstrapMethod])){
+            $newMethod = key($this->installBootstrapMethodList);
+            msg_dialog::display(_("Error"), 
+                sprintf(_("The selected bootstrap method '%s' is invalid! Using '%s' instead!"),
+                $this->installBootstrapMethod,$newMethod), ERROR_DIALOG);
+            $this->installBootstrapMethod = $newMethod;
+        }
+        if(!isset($this->installConfigManagementList[$this->installBootstrapMethod][$this->installConfigManagement])){
+            $newMethod = key($this->installConfigManagementList[$this->installBootstrapMethod]);
+            msg_dialog::display(_("Error"), 
+                sprintf(_("The selected config management method '%s' is invalid! Using '%s' instead!"),
+                $this->installConfigManagement,$newMethod), ERROR_DIALOG);
+            $this->installConfigManagement = $newMethod;
+        }
     }