Code

Replaced 'kickstart' with 'install' names, see new schema file for installable devices
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Oct 2010 12:00:02 +0000 (12:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Oct 2010 12:00:02 +0000 (12:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20059 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 05b5b0be728d4a01f1796678b15c0b6862c1d2c3..58e19b7523c05630251ba2a385956233fa4f89b9 100644 (file)
@@ -2,21 +2,21 @@
 <h3>{t}Installation type{/t}</h3>
 <table>
     <tr>
-        <td><LABEL for="kickstartBootstrapMethod">{t}Bootstrap method{/t}</LABEL></td>
+        <td><LABEL for="installBootstrapMethod">{t}Bootstrap method{/t}</LABEL></td>
         <td>
-            <select name="kickstartBootstrapMethod" size=1>
-                {html_options options=$kickstartBootstrapMethodList 
-                selected=$kickstartBootstrapMethod}
+            <select name="installBootstrapMethod" size=1>
+                {html_options options=$installBootstrapMethodList 
+                selected=$installBootstrapMethod}
             </select>
         </td>
     </tr>
     <tr>
-        <td><LABEL for="kickstartConfigManagement">{t}Config management{/t}</LABEL></td>
+        <td><LABEL for="installConfigManagement">{t}Config management{/t}</LABEL></td>
         <td>
-            <select name="kickstartConfigManagement" size=1
+            <select name="installConfigManagement" size=1
                 onChange='document.mainform.submit();'>
-                {html_options options=$kickstartConfigManagementList 
-                selected=$kickstartConfigManagement}
+                {html_options options=$installConfigManagementList 
+                selected=$installConfigManagement}
             </select>
         </td>
     </tr>
     
             <table>
                 <tr>
-                    <td><LABEL for="kickstartMirrorDN">{t}Mirror{/t}</LABEL></td>
+                    <td><LABEL for="installMirrorDN">{t}Mirror{/t}</LABEL></td>
                     <td>
-                        <select name="kickstartMirrorDN" size=1>
-                            {html_options options=$kickstartMirrorDNList 
-                            selected=$kickstartMirrorDN}
+                        <select name="installMirrorDN" size=1>
+                            {html_options options=$installMirrorDNList 
+                            selected=$installMirrorDN}
                         </select>
                     </td>
                 </tr>
                 <tr>
-                    <td><LABEL for="kickstartTemplateDN">{t}Kickstart template{/t}</LABEL></td>
+                    <td><LABEL for="installTemplateDN">{t}Kickstart template{/t}</LABEL></td>
                     <td>
-                        <select name="kickstartTemplateDN" size=1>
-                            {html_options options=$kickstartTemplateDNList 
-                            selected=$kickstartTemplateDN}
+                        <select name="installTemplateDN" size=1>
+                            {html_options options=$installTemplateDNList 
+                            selected=$installTemplateDN}
                         </select>
                     </td>
                 </tr>
                 <tr>
-                    <td><LABEL for="kickstartKernelPackage">{t}Kernel package{/t}</LABEL></td>
+                    <td><LABEL for="installKernelPackage">{t}Kernel package{/t}</LABEL></td>
                     <td>
-                        <select name="kickstartKernelPackage" size=1>
-                            {html_options values=$kickstartKernelPackageList output=$kickstartKernelPackageList 
-                            selected=$kickstartKernelPackage}
+                        <select name="installKernelPackage" size=1>
+                            {html_options values=$installKernelPackageList output=$installKernelPackageList 
+                            selected=$installKernelPackage}
                         </select>
                     </td>
                 </tr>
             <table>
                 <tr>
                     <td>
-                        <input type='checkbox' value='1' {if $kickstartRootEnabled} checked {/if}
+                        <input type='checkbox' value='1' {if $installRootEnabled} checked {/if}
                             onClick="changeState('setKickstartRootPasswordHash');"
-                            name="kickstartRootEnabled" id="kickstartRootEnabled" 
+                            name="installRootEnabled" id="installRootEnabled" 
                            >
-                        <LABEL for="kickstartRootEnabled">{t}Use root-user{/t}</LABEL>&nbsp;
+                        <LABEL for="installRootEnabled">{t}Use root-user{/t}</LABEL>&nbsp;
                         <button name='setKickstartRootPasswordHash'
-                            {if !$kickstartRootEnabled} disabled {/if}
+                            {if !$installRootEnabled} disabled {/if}
                             id="setKickstartRootPasswordHash">{t}Set password{/t}</button>
                     </td>
                 </tr>
 
             <table>
                 <tr>
-                    <td><LABEL for="kickstartKeyboardlayout">{t}Keyboard layout{/t}</LABEL></td>
+                    <td><LABEL for="installKeyboardlayout">{t}Keyboard layout{/t}</LABEL></td>
                     <td>
-                        <select name="kickstartKeyboardlayout" size=1>
-                            {html_options values=$kickstartKeyboardlayoutList output=$kickstartKeyboardlayoutList 
-                            selected=$kickstartKeyboardlayout}
+                        <select name="installKeyboardlayout" size=1>
+                            {html_options values=$installKeyboardlayoutList output=$installKeyboardlayoutList 
+                            selected=$installKeyboardlayout}
                         </select>
                     </td>
                 </tr>
                 <tr>
-                    <td><LABEL for="kickstartSystemLocale">{t}System locale{/t}</LABEL></td>
+                    <td><LABEL for="installSystemLocale">{t}System locale{/t}</LABEL></td>
                     <td>
-                        <select name="kickstartSystemLocale" size=1>
-                            {html_options values=$kickstartSystemLocaleList output=$kickstartSystemLocaleList 
-                            selected=$kickstartSystemLocale}
+                        <select name="installSystemLocale" size=1>
+                            {html_options values=$installSystemLocaleList output=$installSystemLocaleList 
+                            selected=$installSystemLocale}
                         </select>
                     </td>
                 </tr>
             <table>
                 <tr>
                     <td>
-                        <input type='checkbox' name="kickstartTimeUTC" id="kickstartTimeUTC" 
-                        {if $kickstartTimeUTC} checked {/if}>
-                        <LABEL for="kickstartTimeUTC">{t}Use UTC{/t}</LABEL>
+                        <input type='checkbox' name="installTimeUTC" id="installTimeUTC" 
+                        {if $installTimeUTC} checked {/if}>
+                        <LABEL for="installTimeUTC">{t}Use UTC{/t}</LABEL>
                     </td>
                 </tr>
                 <tr>
-                    <td><LABEL for="kickstartTimezone">{t}Timezone{/t}</LABEL></td>
+                    <td><LABEL for="installTimezone">{t}Timezone{/t}</LABEL></td>
                     <td>
-                        <select size='1' name="kickstartTimezone" id="kickstartTimezone">
-                            {html_options values=$timezones options=$timezones selected=$kickstartTimezone}
+                        <select size='1' name="installTimezone" id="installTimezone">
+                            {html_options values=$timezones options=$timezones selected=$installTimezone}
                         </select>
                     </td>
                 </tr>
                 <tr>    
                     <td colspan=2>
                         {t}NTP server{/t}
-                        {$kickstartNTPServerList}
-                        <input type='text' name="kickstartNTPServer_Input">
-                        <button name='kickstartNTPServer_Add'>{msgPool type=addButton}</button>
+                        {$installNTPServerList}
+                        <input type='text' name="installNTPServer_Input">
+                        <button name='installNTPServer_Add'>{msgPool type=addButton}</button>
                     </td>
                 </tr>
             </table>
 <h3>{t}Partition table{/t}</h3>
 <table>
     <tr>
-        <td><LABEL for="kickstartPartitionTable">{t}Partition table{/t}</LABEL></td>
+        <td><LABEL for="installPartitionTable">{t}Partition table{/t}</LABEL></td>
         <td>
-            <input type='text' name="kickstartPartitionTable" id="kickstartPartitionTable" value="{$kickstartPartitionTable}">
+            <input type='text' name="installPartitionTable" id="installPartitionTable" value="{$installPartitionTable}">
         </td>
     </tr>
 </table>
index 3718329c3fa3bd9b28fd0d4153b8a80161e54fef..5bd3d58a7a2b4e7d064f4e3b6f3af6fd40175a7b 100644 (file)
@@ -3,43 +3,43 @@
 class InstallRecipe extends plugin
 {
 
-    public $kickstartBootstrapMethod = '';
-    public $kickstartBootstrapMethodList = NULL;
+    public $installBootstrapMethod = '';
+    public $installBootstrapMethodList = NULL;
 
-    public $kickstartConfigManagement = '';
-    public $kickstartConfigManagementList = NULL;
+    public $installConfigManagement = '';
+    public $installConfigManagementList = NULL;
 
-    public $kickstartTemplateDN = "";
-    public $kickstartTemplateDNList = array(
+    public $installTemplateDN = "";
+    public $installTemplateDNList = array(
         'dc=intranet,dc=gonicus,dc=de' => 'Intranet-Tpl',
         'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System-Tpl');
 
-    public $kickstartMirrorDN = "";
-    public $kickstartMirrorDNList = array(
+    public $installMirrorDN = "";
+    public $installMirrorDNList = array(
         'dc=intranet,dc=gonicus,dc=de' => 'Intranet',
         'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System');
-    public $kickstartKernelPackage = "";
-    public $kickstartKernelPackageList = array('kernel1','kk1');
-    public $kickstartKeyboardlayout = "";
-    public $kickstartKeyboardlayoutList = array("104","105");
-    public $kickstartSystemLocale = "";
-    public $kickstartSystemLocaleList = array('de','en_EN.UTF-8');
-    public $kickstartTimezone = "";
-    public $kickstartTimeUTC = "";
-    public $kickstartNTPServer = array();
-    public $kickstartRootEnabled = "";
-    public $kickstartRootPasswordHash = "";
-    public $kickstartPartitionTable = "";
+    public $installKernelPackage = "";
+    public $installKernelPackageList = array('kernel1','kk1');
+    public $installKeyboardlayout = "";
+    public $installKeyboardlayoutList = array("104","105");
+    public $installSystemLocale = "";
+    public $installSystemLocaleList = array('de','en_EN.UTF-8');
+    public $installTimezone = "";
+    public $installTimeUTC = "";
+    public $installNTPServer = array();
+    public $installRootEnabled = "";
+    public $installRootPasswordHash = "";
+    public $installPartitionTable = "";
 
     public $objectclasses = array('installRecipe');
-    public $attributes = array("kickstartTemplateDN","kickstartKeyboardlayout","kickstartSystemLocale",
-            "kickstartTimezone","kickstartTimeUTC","kickstartNTPServer","kickstartMirrorDN",
-            "kickstartRootEnabled","kickstartRootPasswordHash","kickstartKernelPackage",
-            "kickstartPartitionTable","kickstartConfigManagement","kickstartBootstrapMethod");
+    public $attributes = array("installTemplateDN","installKeyboardlayout","installSystemLocale",
+            "installTimezone","installTimeUTC","installNTPServer","installMirrorDN",
+            "installRootEnabled","installRootPasswordHash","installKernelPackage",
+            "installPartitionTable","installConfigManagement","installBootstrapMethod");
 
     public $setKickstartRootPasswordHash = FALSE;
 
-    private $kickstartNTPServerList = NULL;
+    private $installNTPServerList = NULL;
 
     function __construct(&$config, $dn)
     {
@@ -50,7 +50,7 @@ class InstallRecipe extends plugin
 
             // Preset the device timezone
             $tz = timezone::get_default_timezone();
-            $this->kickstartTimezone = $tz['name'];
+            $this->installTimezone = $tz['name'];
         }
 
         // Prepare list of timezones
@@ -76,20 +76,20 @@ class InstallRecipe extends plugin
         $this->hash = $this->config->get_cfg_value("core","passwordDefaultHash"); 
 
         // Get list of NTP servers
-        $this->kickstartNTPServer = array();
-        if(isset($this->attrs['kickstartNTPServer']['count'])){
-            for($i = 0; $i < $this->attrs['kickstartNTPServer']['count']; $i++){
-                $this->kickstartNTPServer[] = $this->attrs['kickstartNTPServer'][$i];
+        $this->installNTPServer = array();
+        if(isset($this->attrs['installNTPServer']['count'])){
+            for($i = 0; $i < $this->attrs['installNTPServer']['count']; $i++){
+                $this->installNTPServer[] = $this->attrs['installNTPServer'][$i];
             }
         }
 
         // Prepare NTP servers list 
-        $this->kickstartNTPServerList= new sortableListing($this->kickstartNTPServer);
-        $this->kickstartNTPServerList->setDeleteable(true);
-        $this->kickstartNTPServerList->setEditable(false);
-        $this->kickstartNTPServerList->setColspecs(array('*'));
-        $this->kickstartNTPServerList->setWidth("100%");
-        $this->kickstartNTPServerList->setHeight("70px");
+        $this->installNTPServerList= new sortableListing($this->installNTPServer);
+        $this->installNTPServerList->setDeleteable(true);
+        $this->installNTPServerList->setEditable(false);
+        $this->installNTPServerList->setColspecs(array('*'));
+        $this->installNTPServerList->setWidth("100%");
+        $this->installNTPServerList->setHeight("70px");
 
         // Load list of bootstrap methods.
         $this->loadInstallationMethods();
@@ -98,22 +98,22 @@ class InstallRecipe extends plugin
     
     function loadInstallationMethods()
     { 
-        $this->kickstartBootstrapMethodList = array();
-        $this->kickstartConfigManagementList = array();
+        $this->installBootstrapMethodList = array();
+        $this->installConfigManagementList = array();
         $rpc = $this->config->getRpcHandle();
         $res = $rpc->getSupportedBaseInstallMethods();
         foreach($res as $name => $method){
-            $this->kickstartBootstrapMethodList[$name] = $method['name'];
+            $this->installBootstrapMethodList[$name] = $method['name'];
             foreach($method['methods'] as $m){
-                $this->kickstartConfigManagementList[$name][$m] = $m; 
+                $this->installConfigManagementList[$name][$m] = $m; 
             }
         }
         
-        if(empty($this->kickstartBootstrapMethod)){
-            $this->kickstartBootstrapMethod = key($this->kickstartBootstrapMethodList);
+        if(empty($this->installBootstrapMethod)){
+            $this->installBootstrapMethod = key($this->installBootstrapMethodList);
         }
-        if(empty($this->kickstartConfigManagement)){
-            $this->kickstartConfigManagement = key($this->kickstartConfigManagementList[$this->kickstartBootstrapMethod]);
+        if(empty($this->installConfigManagement)){
+            $this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
         }
     }
     
@@ -128,25 +128,25 @@ class InstallRecipe extends plugin
             return($smarty->fetch(get_template_path('goto/Device/SetPassword.tpl', TRUE)));
         }
 
-        $this->kickstartNTPServerList->setAcl($this->getacl('kickstartNTPServer'));
-        $this->kickstartNTPServerList->update();
+        $this->installNTPServerList->setAcl($this->getacl('installNTPServer'));
+        $this->installNTPServerList->update();
 
         plugin::execute();    
         $smarty = get_smarty();
         $smarty->assign('timezones', $this->timezones);
-        $smarty->assign('kickstartKeyboardlayoutList', $this->kickstartKeyboardlayoutList);
-        $smarty->assign('kickstartKernelPackageList', $this->kickstartKernelPackageList);
-        $smarty->assign('kickstartTemplateDNList', $this->kickstartTemplateDNList);
-        $smarty->assign('kickstartMirrorDNList', $this->kickstartMirrorDNList);
-        $smarty->assign('kickstartSystemLocaleList', $this->kickstartSystemLocaleList);
-        $smarty->assign('kickstartNTPServerList', $this->kickstartNTPServerList->render());
-
-        $smarty->assign('kickstartBootstrapMethod', $this->kickstartBootstrapMethod);
-        $smarty->assign('kickstartBootstrapMethodList', $this->kickstartBootstrapMethodList);
-        $smarty->assign('kickstartConfigManagement', $this->kickstartConfigManagement);
-
-        $cfgList = $this->kickstartConfigManagementList[$this->kickstartBootstrapMethod];
-        $smarty->assign('kickstartConfigManagementList', $cfgList);
+        $smarty->assign('installKeyboardlayoutList', $this->installKeyboardlayoutList);
+        $smarty->assign('installKernelPackageList', $this->installKernelPackageList);
+        $smarty->assign('installTemplateDNList', $this->installTemplateDNList);
+        $smarty->assign('installMirrorDNList', $this->installMirrorDNList);
+        $smarty->assign('installSystemLocaleList', $this->installSystemLocaleList);
+        $smarty->assign('installNTPServerList', $this->installNTPServerList->render());
+
+        $smarty->assign('installBootstrapMethod', $this->installBootstrapMethod);
+        $smarty->assign('installBootstrapMethodList', $this->installBootstrapMethodList);
+        $smarty->assign('installConfigManagement', $this->installConfigManagement);
+
+        $cfgList = $this->installConfigManagementList[$this->installBootstrapMethod];
+        $smarty->assign('installConfigManagementList', $cfgList);
         foreach($this->attributes as $attr){
             $smarty->assign($attr, $this->$attr);
         }
@@ -161,27 +161,27 @@ class InstallRecipe extends plugin
         
         if(isset($_POST['InstallRecipePosted'])){
 
-            $currentInstallMethod = $this->kickstartConfigManagement;
+            $currentInstallMethod = $this->installConfigManagement;
             plugin::save_object();
-            $this->kickstartRootEnabled = isset($_POST['kickstartRootEnabled']);
-            $this->kickstartTimeUTC = isset($_POST['kickstartTimeUTC']);
+            $this->installRootEnabled = isset($_POST['installRootEnabled']);
+            $this->installTimeUTC = isset($_POST['installTimeUTC']);
 
 
             if(isset($_POST['setKickstartRootPasswordHash'])){
                 $this->setKickstartRootPasswordHash = true;
             }
 
-            $this->kickstartNTPServerList->save_object();
-            $this->kickstartNTPServer = $this->kickstartNTPServerList->getMaintainedData();
-            if(isset($_POST['kickstartNTPServer_Input']) && isset($_POST['kickstartNTPServer_Add'])){
-                $add = get_post('kickstartNTPServer_Input');
-                if(!in_array($add, $this->kickstartNTPServer) && !empty($add)){
-                    $this->kickstartNTPServer[] = $add;
+            $this->installNTPServerList->save_object();
+            $this->installNTPServer = $this->installNTPServerList->getMaintainedData();
+            if(isset($_POST['installNTPServer_Input']) && isset($_POST['installNTPServer_Add'])){
+                $add = get_post('installNTPServer_Input');
+                if(!in_array($add, $this->installNTPServer) && !empty($add)){
+                    $this->installNTPServer[] = $add;
                 }
             }
-            $this->kickstartNTPServerList->setListData($this->kickstartNTPServer);
+            $this->installNTPServerList->setListData($this->installNTPServer);
 
-            if($currentInstallMethod != $this->kickstartConfigManagement){
+            if($currentInstallMethod != $this->installConfigManagement){
                 $this->updateRecipeTab();
             }
         }
@@ -197,7 +197,7 @@ class InstallRecipe extends plugin
             $methods = new passwordMethod($this->config, $this->dn);
             $available = $methods->get_available_methods();
             $test = new $available[$hash]($this->config,$this->dn);
-            $this->kickstartRootPasswordHash = @$test->generate_hash(get_post('rootPassword'));
+            $this->installRootPasswordHash = @$test->generate_hash(get_post('rootPassword'));
         }
 
     }
@@ -205,7 +205,7 @@ class InstallRecipe extends plugin
 
     function updateRecipeTab()
     {
-        $mode = $this->kickstartConfigManagement;
+        $mode = $this->installConfigManagement;
         if(!isset($this->recipeTabs[$mode])){
             $this->recipeTabs[$mode] = new DeviceConfig($this->config, $this->dn);
             $this->recipeTabs[$mode]->parent = &$this->parent;
@@ -272,9 +272,9 @@ class InstallRecipe extends plugin
     function save()
     {
         // 
-        if(!$this->kickstartRootEnabled) $this->kickstartRootPasswordHash = "";
-        $this->kickstartRootEnabled = ($this->kickstartRootEnabled)?'TRUE':'FALSE';
-        $this->kickstartTimeUTC = ($this->kickstartTimeUTC)?'TRUE':'FALSE';
+        if(!$this->installRootEnabled) $this->installRootPasswordHash = "";
+        $this->installRootEnabled = ($this->installRootEnabled)?'TRUE':'FALSE';
+        $this->installTimeUTC = ($this->installTimeUTC)?'TRUE':'FALSE';
         
 
         plugin::save();
@@ -304,19 +304,19 @@ class InstallRecipe extends plugin
                     "plCategory"    => array("Device"),
                     "plProvidedAcls" => array(
                         "member" => _("Member"),
-                        "kickstartTemplateDN" => _("Template"),
-                        "kickstartBootstrapMethod" => _("Bootstrap method"),
-                        "kickstartConfigManagement" => _("Config management"),
-                        "kickstartKeyboardlayout" => _("Keyboard layout"),
-                        "kickstartSystemLocale" => _("System locale"),
-                        "kickstartTimezone" => _("Timezone"),
-                        "kickstartTimeUTC" => _("Time"),
-                        "kickstartNTPServer" => _("NTP-Server"),
-                        "kickstartMirrorDN" => _("Kickstart mirror"),
-                        "kickstartRootEnabled" => _("Root login enabled"),
-                        "kickstartRootPasswordHash" => _("Root password hash"),
-                        "kickstartKernelPackage" => _("Kernal package"),
-                        "kickstartPartitionTable" => _("Partition table")
+                        "installTemplateDN" => _("Template"),
+                        "installBootstrapMethod" => _("Bootstrap method"),
+                        "installConfigManagement" => _("Config management"),
+                        "installKeyboardlayout" => _("Keyboard layout"),
+                        "installSystemLocale" => _("System locale"),
+                        "installTimezone" => _("Timezone"),
+                        "installTimeUTC" => _("Time"),
+                        "installNTPServer" => _("NTP-Server"),
+                        "installMirrorDN" => _("Kickstart mirror"),
+                        "installRootEnabled" => _("Root login enabled"),
+                        "installRootPasswordHash" => _("Root password hash"),
+                        "installKernelPackage" => _("Kernal package"),
+                        "installPartitionTable" => _("Partition table")
                         )
                         )
                         );