Code

Updated Installation method handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Oct 2010 08:07:11 +0000 (08:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Oct 2010 08:07:11 +0000 (08:07 +0000)
-Fixed problem with selection of invalid installation methods

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

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc

index 19f1a37b3b13b1682df02dfb83abe3ec157f0201..2d02c531c824f092366aa7068775aecd16e4a133 100644 (file)
@@ -74,16 +74,15 @@ class DeviceConfig extends management
     {
         $this->is_account = FALSE;
         if(!isset($this->allItemConfigurations[$str])){
-            trigger_error("Invalid install method '{$str}'!");
             $this->itemConfig = array();
             $this->invalidInstallMethod =TRUE;
             $this->errorMessage = sprintf(_("Invalid installation method selected '%s'!"), $str);
+            msg_dialog::display(_("Setup"), $this->errorMessage, ERROR_DIALOG);
+            return(FALSE);
         }else{
 
             $this->itemConfig = $this->allItemConfigurations[$str]['items'];
             $this->invalidInstallMethod =FALSE;
-
-            // Load the template 
             $this->TemplateEngine->load($this->itemConfig);
 
             // Detect root item, its name is / 
@@ -95,11 +94,11 @@ class DeviceConfig extends management
                 }
             }
             if(!$root){
-                $this->errorMessage = _("No valid install methods returned, missing root object!");
+                $this->errorMessage = sprintf(_("Installation method '%s' is invalid, no root object found!"), $str);
                 msg_dialog::display(_("Setup"), $this->errorMessage , ERROR_DIALOG);
                 $this->initFailed = TRUE;
                 $this->itemConfig = array();
-                return;
+                return(FALSE);
             }
 
             // Set current item to 'root', this is the minimum to get things running.
@@ -109,6 +108,7 @@ class DeviceConfig extends management
             $this->setSelectedListItemID($idRoot);
             $this->is_account = TRUE;
             $this->rebuildListing();
+            return(TRUE);
         }
     }