Code

Removed dummy code.
[gosa.git] / gosa-plugins / goto / admin / systems / goto / Device / class_InstallRecipe.inc
index b5ccec7a208a48c8323fcb182a6039cc561e0c9d..2b3d9a6b59ed5c06b6668c5ab4b8cf80ae765ea4 100644 (file)
@@ -148,6 +148,7 @@ class InstallRecipe extends plugin
             }
         } 
 
+        
         // Update selectable items like kernels and mirrors depending on the current setup (relase)
         $this->installBootstrapMethod = $this->installationTemplates[$this->installTemplate]['method'];
         $this->reloadInstallationKernelPackages($initially);
@@ -155,7 +156,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]);
+            }
         }
     }
 
@@ -168,6 +172,7 @@ class InstallRecipe extends plugin
             return;
         }
 
+        // Load base install Method
         $rpc = $this->config->getRpcHandle();
         $res = $rpc->systemGetBaseInstallParameters($this->deviceUUID);
        
@@ -367,10 +372,14 @@ class InstallRecipe extends plugin
 
         plugin::execute();    
         $smarty = get_smarty();
-        $smarty->assign('installTemplateList', $this->installationTemplateNames);
-        $smarty->assign('installReleaseList', $this->templateToRelease[$this->installTemplate]);
 
+        // Assign ACLs
+        foreach($this->attributes as $attr){
+            $smarty->assign("{$attr}ACL", $this->getacl($attr));
+        }
 
+        $smarty->assign('installTemplateList', $this->installationTemplateNames);
+        $smarty->assign('installReleaseList', $this->templateToRelease[$this->installTemplate]);
         $smarty->assign('timezones', $this->timezones);
         $smarty->assign('installKeyboardlayoutList', $this->installKeyboardlayoutList);
         $smarty->assign('installKernelPackageList', $this->installKernelPackageList);
@@ -458,7 +467,6 @@ class InstallRecipe extends plugin
         if(!$this->installRootEnabled) $this->installRootPasswordHash = "";
 
         $map = array(
-            "installNTPServer"=>'ntp-servers',
             "installTemplate"=>'template',
             "installRelease"=>'release',
             "installTimezone"=>'timezone',
@@ -469,6 +477,7 @@ class InstallRecipe extends plugin
             "installRootPasswordHash"=>'root-hash',
             "installPartitionTable"=>'disk-setup',
             "installKeyboardlayout"=>'keyboard-layout',
+            "installBootstrapMethod"=>'method',
             );
 
         // Collect values to be saved.
@@ -480,7 +489,9 @@ class InstallRecipe extends plugin
         } 
 
         // Enforce an array for ntp-servers
-        $data['ntp-servers'] = array_values($data['ntp-servers']);
+        if(!empty($this->installNTPServer)){
+            $data['ntp-servers'] = array_values($this->installNTPServer);
+        }
 
         // Save Boolean like a String 
         $boolean = array("root-user" => "installRootEnabled", "utc" => "installTimeUTC");
@@ -488,17 +499,17 @@ class InstallRecipe extends plugin
             $data[$attr] = ($this->$source) ? $data[$attr] = "TRUE" : $data[$attr] = "FALSE";
         }
 
+        // Set the base installation parameters
         $rpc = $this->config->getRpcHandle();
         $res = $rpc->systemSetBaseInstallParameters($this->deviceUUID, $data);
        
-        // Failed to load backend values, keep reported error and return with FALSE; 
+        // Handle errors
         $this->rpcError = !$rpc->success();
         if(!$rpc->success()){
             $this->rpcErrorMessage = $rpc->get_error();
             msg_dialog::display(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
             return(NULL);
         }
-
     }
 
     
@@ -518,9 +529,10 @@ class InstallRecipe extends plugin
             return;
         }
 
+        $release = preg_replace("/^[^\/]*\//","", $this->installRelease);
         $rpc = $this->config->getRpcHandle();
-        $res = $rpc->getKernelPackages($this->installRelease);
-      
+        $res = $rpc->getKernelPackages($release);
+     
         // Failed to load backend values, keep reported error and return with FALSE; 
         $this->rpcError = !$rpc->success();
         if(!$rpc->success()){
@@ -528,13 +540,14 @@ class InstallRecipe extends plugin
             msg_dialog::display(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
         }else{
             $this->installKernelPackageList = array();
-            foreach($res as $name){
+            foreach($res as $data){
+                $name = $data['name'];
                 $this->installKernelPackageList[$name] = $name;
             }
 
             if(!isset($this->installKernelPackageList[$this->installKernelPackage])){
                 $new = key($this->installKernelPackageList);
-                if($initially){
+                if($initially && $this->is_account){
                     msg_dialog::display(_("Warning"), sprintf(_("The selected kernel package '%s' is no longer available! The kernel package '%s' was selected as replacement!"), $this->installKernelPackage, $new), WARNING_DIALOG);
                 }
                 $this->installKernelPackage = $new;
@@ -690,21 +703,20 @@ class InstallRecipe extends plugin
                     "plSection"     => array("administration"),
                     "plCategory"    => array("Device"),
                     "plProvidedAcls" => array(
-                        "member" => _("Member"),
-                        "installTemplate" => _("Installation template"),
-                        "installRelease" => _("Installation release"),
 
-                        "installBootstrapMethod" => _("Bootstrap method"),
-                        "installConfigManagement" => _("Config management"),
+                        "installRelease" => _("Release"),
+                        "installTemplate" => _("Template"),
                         "installKeyboardlayout" => _("Keyboard layout"),
-                        "installSystemLocale" => _("System locale"),
+                        "installSystemLocale" => _("Locale"),
                         "installTimezone" => _("Timezone"),
-                        "installTimeUTC" => _("Time"),
-                        "installNTPServer" => _("NTP-Server"),
+                        "installTimeUTC" => _("Utc"),
+                        "installNTPServer" => _("Ntp server"),
                         "installMirror" => _("Mirror"),
                         "installRootEnabled" => _("Root login enabled"),
                         "installRootPasswordHash" => _("Root password hash"),
                         "installKernelPackage" => _("Kernel package"),
+                        "installConfigManagement" => _("Config mangement"),
+                        "installBootstrapMethod" => _("Bootstrap method"),
                         "installPartitionTable" => _("Partition table")
                         )
                         )