Code

Updated config mangement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:10:05 +0000 (12:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:10:05 +0000 (12:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20847 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 208b7fa8c945e031601ad50c79d0103bb37aa00e..52decfb568c3aecd2a86ac7ef85f19236f168bd3 100644 (file)
@@ -86,19 +86,20 @@ class DeviceConfig extends plugin
             if(!$rpc->success()){
                 $smarty = get_smarty();
                 $smarty->assign("error", TRUE);
-                $smarty->assign("errorMsg", msgPool::rpcError($this->rpcErrorMessage));
-                return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
+                $smarty->assign("errorMsg", msgPool::rpcError($rpc->get_error()));
+                return($smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
             }
            
  
             // Load assignable elements.
             $release = $this->parent->by_object['InstallRecipe']->installRelease;
+            $release = preg_replace("/^[^\/]+\//","", $release);
             $assignableElements = $rpc->listAssignableElements($release);
             if(!$rpc->success()){
                 $smarty = get_smarty();
                 $smarty->assign("error", TRUE);
-                $smarty->assign("errorMsg", msgPool::rpcError($this->rpcErrorMessage));
-                return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
+                $smarty->assign("errorMsg", msgPool::rpcError($rpc->get_error()));
+                return($smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
             }else{
 
                 // Initialization completed.
@@ -271,8 +272,7 @@ class DeviceConfig extends plugin
         $rpc->systemSetConfigParameters($this->deviceUUID, array('method' => $installConfigManagement, 
                     'var' => $save, 'item' => $this->usedElements));
         if(!$rpc->success()){
-            $this->rpcErrorMessage = $rpc->get_error();
-            msg_dialog::display(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+            msg_dialog::display(_("Error"), msgPool::rpcError($rpc->get_error()), ERROR_DIALOG);
             return(NULL);
         }
     }
@@ -286,8 +286,7 @@ class DeviceConfig extends plugin
         $rpc = $this->config->getRpcHandle();
         $rpc->removeConfigParameters($this->deviceUUID);
         if(!$rpc->success()){
-            $this->rpcErrorMessage = $rpc->get_error();
-            msg_dialog::display(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+            msg_dialog::display(_("Error"), msgPool::rpcError($rpc->get_error()), ERROR_DIALOG);
             return(NULL);
         }
     }
index b5ccec7a208a48c8323fcb182a6039cc561e0c9d..d7694e6f68a50370b3e77263425a5fb4891f140b 100644 (file)
@@ -155,7 +155,10 @@ class InstallRecipe extends plugin
 
         // Preset the config management method.
         if(!isset($this->installConfigManagementList[$this->installBootstrapMethod][$this->installConfigManagement])){
-            $this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
+            if(isset($this->installConfigManagementList[$this->installBootstrapMethod]) && 
+                count($this->installConfigManagementList[$this->installBootstrapMethod])){
+                $this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
+            }
         }
     }