Commit 1e62dc36 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Present a menu of OSID's when changing the node parameters, as per

Mike request many months ago. Possible now that we have a proper osid
table.
parent 4cca6b04
......@@ -42,6 +42,10 @@ if (! $isadmin) {
}
}
if (isset($def_boot_osid) && strcmp($def_boot_osid, "None") == 0) {
$def_boot_osid = "";
}
#
# Now change the information.
#
......
......@@ -61,6 +61,24 @@ $next_boot_cmd_line = $row[next_boot_cmd_line];
$rpms = $row[rpms];
$startupcmd = $row[startupcmd];
#
# Get the OSID list.
#
if ($isadmin) {
$osid_result = mysql_db_query($TBDBNAME,
"SELECT * FROM os_info order by osid");
}
else {
$osid_result = mysql_db_query($TBDBNAME,
"select distinct o.* from os_info as o ".
"left join proj_memb as p on o.pid IS NULL or p.pid=o.pid ".
"where p.uid='$uid' order by o.pid,o.osid");
}
if (! $osid_result) {
$err = mysql_error();
TBERROR("Database Error getting OSID list: $err\n", 1);
}
echo "<table border=2 cellpadding=0 cellspacing=2
align='center'>\n";
......@@ -86,13 +104,28 @@ echo "<tr>
</tr>\n";
#
# This should be a menu.
#
# OSID, as a menu of those allowed.
#
echo "<tr>
<td>Def Boot OSID:</td>
<td class=\"left\">
<input type=\"text\" name=\"def_boot_osid\" size=\"30\"
value=\"$def_boot_osid\"></td>
<td>*Def Boot OSID:</td>";
echo " <td><select name=\"def_boot_osid\">\n";
while ($row = mysql_fetch_array($osid_result)) {
$osid = $row[osid];
$pid = $row[pid];
if (!$pid)
$pid = "testbed";
echo "<option ";
if ($def_boot_osid == $osid) {
echo "selected ";
}
echo "value=\"$osid\">$pid - $osid</option>\n";
}
if ($isadmin) {
echo "<option value=\"None\">No OSID</option>\n";
}
echo " </select>";
echo " </td>
</tr>\n";
echo "<tr>
......
......@@ -91,10 +91,13 @@ while ($row = mysql_fetch_array($query_result)) {
<td>$node_id</td>
<td>$type</td>
<td>$pid</td>
<td>$eid</td>
<td><A href='showosinfo.php3?osid=$def_boot_osid'>
$def_boot_osid</A></td>
<td>$def_boot_path</td>
<td>$eid</td>\n";
if ($def_boot_osid)
echo "<td><A href='showosinfo.php3?osid=$def_boot_osid'>
$def_boot_osid</A></td>\n";
else
echo "<td>&nbsp</td>\n";
echo " <td>$def_boot_path</td>
<td>$def_boot_cmd_line</td>
<td>$next_boot_path</td>
<td>$next_boot_cmd_line</td>
......
......@@ -328,8 +328,14 @@ function SHOWNODES($pid, $eid) {
<img alt=\"o\" src=\"redball.gif\"></A></td>
<td>$node_id</td>
<td>$vname</td>
<td>$type</td>
<td>$def_boot_osid</td>
<td>$type</td>\n";
if ($def_boot_osid)
echo "<td><A href='showosinfo.php3?osid=$def_boot_osid'>
$def_boot_osid</A></td>\n";
else
echo "<td>&nbsp</td>\n";
echo " <td>$def_boot_osid</td>
<td>$def_boot_path</td>
<td>$def_boot_cmd_line</td>
<td>$startupcmd</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment