Code

Added boot kernel hook
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 10:30:12 +0000 (10:30 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 10:30:12 +0000 (10:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3005 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/terminalStartup.tpl
plugins/admin/systems/workstationStartup.tpl

index 35b521d49017d7f58a3f8469f8eff43db334b6b1..f893dd0f6133adf38363b82608952dfe525dfc1b 100644 (file)
@@ -9,11 +9,12 @@ class termstartup extends plugin
   /* Generic terminal attributes */
   var $bootmode= "G";
   var $goLdapServerList= array("default");
-  var $gotoBootKernel= "default";
+  var $gotoBootKernel= "";
   var $gotoKernelParameters= "";
   var $gotoLdapServer= "";
   var $gotoModules= array();
   var $gotoTerminalPath= "";
+  var $gotoBootKernels= array("default");
 
   /* Share */
   var $gotoShares         = array();// Currently Share Option
@@ -81,6 +82,26 @@ class termstartup extends plugin
     $this->gotoAvailableShares= $config->getShareList(false);
 
     $this->orig_dn= $this->dn;
+
+    /* Get list of boot kernels */
+    if (isset($this->config->data['TABS'])){
+      $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS");
+
+      if (!check_command($command)){
+        $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command,
+            get_class($this));
+      } else {
+        $fh= popen($command, "r");
+        while (!feof($fh)) {
+          $buffer= fgets($fh, 256);
+          $this->gotoBootKernels[]= $buffer;
+        }
+        pclose($fh);
+        sort($this->gotoBootKernels);
+      }
+
+    }
+
   }
 
   function execute()
@@ -124,6 +145,7 @@ class termstartup extends plugin
      */
     $smarty->assign("gotoShareSelections",    $this->gotoShareSelections);
     $smarty->assign("gotoShareSelectionKeys", array_flip($this->gotoShareSelections));
+    $smarty->assign("gotoBootKernels",$this->gotoBootKernels);
 
     /* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
      * This entry will be, a combination of mountPoint and sharedefinitions
index c43f70d4709fd8ff0ecb51d22afad7307e1eb10a..54929b931d63b9f440502c39f5f141f4a7b26f3b 100644 (file)
@@ -9,7 +9,7 @@ class workstartup extends plugin
   /* Generic terminal attributes */
   var $bootmode             = "G";
   var $goLdapServerList     = array("default");
-  var $gotoBootKernel       = "default";
+  var $gotoBootKernel       = "";
   var $gotoKernelParameters = "";
   var $gotoLdapServer       = "";
   var $gotoModules          = array();
@@ -17,7 +17,7 @@ class workstartup extends plugin
   var $gotoFilesystem       = array();
   var $gotoTerminalPath     = "";
   var $FAIstatus            = "";
-
+  var $gotoBootKernels      = array("default");
 
   /* attribute list for save action */
   var $attributes     = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror", "FAIrelease");
@@ -220,6 +220,25 @@ class workstartup extends plugin
     }
 
     $this->orig_dn= $this->dn;
+
+    /* Get list of boot kernels */
+    if (isset($this->config->data['TABS'])){
+      $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS");
+
+      if (!check_command($command)){
+        $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command,
+            get_class($this));
+      } else {
+        $fh= popen($command, "r");
+        while (!feof($fh)) {
+          $buffer= fgets($fh, 256);
+          $this->gotoBootKernels[]= $buffer;
+        }
+        pclose($fh);
+        sort($this->gotoBootKernels);
+      }
+      
+    }
   }
 
   
@@ -360,6 +379,7 @@ class workstartup extends plugin
 
   function execute()
   {
+
        /* Call parent execute */
        plugin::execute();
 
@@ -522,6 +542,7 @@ class workstartup extends plugin
 
     $smarty->assign("gotoShares",$this->printOutAssignedShares());
     $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
+    $smarty->assign("gotoBootKernels",$this->gotoBootKernels);
 
     /* Arrays */
     $tmp = $this->config->data['SERVERS']['LDAP'];
@@ -810,10 +831,7 @@ class workstartup extends plugin
 
     /* Add semi automatic values */
     // FIXME: LDAP Server may not be set here...
-    $this->gotoKernelParameters= "root=/dev/nfs nfsroot=".
-      $this->gotoTerminalPath.
-      ",ro,hard,nolock,fg,rsize=8192 ".
-      "ip=::::::dhcp ldap=".base64_encode($this->gotoLdapServer);
+    $this->gotoKernelParameters= "ldap=".base64_encode($this->gotoLdapServer);
 
     switch ($this->bootmode){
       case "D":
index 3360d9f817c31d35764f0f36c209b52ca8dff6df..9d3897710cd2bf8d9d2aa9c5460f171a7a738857 100644 (file)
@@ -3,16 +3,20 @@
  <tr>
   <td style="width:50%; vertical-align:top;">
 
-   <table summary="">
+   <table summary="" style="width:100%">
     <tr>
-     <td colspan="2" style='vertical-align:top;padding-top:3px;'><LABEL for="gotoLdapServer">{t}LDAP server{/t}</LABEL>
+     <td colspan="2" style='vertical-align:top;padding-top:3px;width:100%'><LABEL for="gotoLdapServer">{t}LDAP server{/t}</LABEL>
                {$SelectBoxLdapServer}
      </td>
     </tr>
     <tr>
-     <td><LABEL for="gotoBootKernel">{t}Boot kernel{/t}</LABEL></td>
-     <td><input id="gotoBootKernel" name="gotoBootKernel" size=20 maxlength=60 {$gotoBootKernelACL}
-                value="{$gotoBootKernel}" title="{t}Enter the filename of the kernel to use{/t}"></td>
+     <td style="width:30%"><LABEL for="gotoBootKernel">{t}Boot kernel{/t}</LABEL></td>
+     <td>
+       <select id="gotoBootKernel" name="gotoBootKernel" {$gotoBootKernelACL} onchange='document.mainform.submit()'>
+       {html_options options=$gotoBootKernels selected=$gotoBootKernel}
+       <option disabled>&nbsp;</option>
+       </select>
+     </td>
     </tr>
     <tr>
      <td><LABEL for="customParameters">{t}Custom options{/t}</LABEL></td>
index 996e6aba4cc2743e91e364f971df3d9929bcbcb3..cfb1112dad947fc11520520574af24202e914f01 100644 (file)
     </tr>
     <tr>
      <td><LABEL for="gotoBootKernel">{t}Boot kernel{/t}</LABEL></td>
-     <td style="width:70%"><input id="gotoBootKernel" name="gotoBootKernel" size=20 maxlength=60 {$gotoBootKernelACL}
-                value="{$gotoBootKernel}" title="{t}Enter the filename of the kernel to use{/t}"></td>
+     <td style="width:70%">
+        <select id="gotoBootKernel" name="gotoBootKernel" {$gotoBootKernelACL} onchange='document.mainform.submit()'>
+         {html_options options=$gotoBootKernels selected=$gotoBootKernel}
+         <option disabled>&nbsp;</option>
+       </select>
+      </td>
     </tr>
     <tr>
      <td><LABEL for="customParameters">{t}Custom options{/t}</LABEL></td>