Commit 7ff17bec authored by Mac Newbold's avatar Mac Newbold
Browse files

Admins can see pid,eid,vname, but mere users only see eid ('reservation status')

parent 50f836ed
......@@ -7,7 +7,7 @@ include("defs.php3");
PAGEHEADER("Utah Testbed Machine Status");
$query_result = mysql_db_query($TBDBNAME,
"SELECT n.node_id, n.type, j.eid FROM nodes ".
"SELECT n.node_id, n.type, j.pid, j.eid, j.vname FROM nodes ".
"AS n LEFT JOIN reserved AS j ON n.node_id = j.node_id ".
"WHERE type='pc' OR type='shark' ORDER BY type,priority");
if (! $query_result) {
......@@ -15,6 +15,8 @@ if (! $query_result) {
TBERROR("Database Error getting node reservation status: $err\n", 1);
}
$isadmin = ISADMIN($uid);
#
# Count the types up.
#
......@@ -51,19 +53,37 @@ echo "<center><h3>
echo "<table border=1 align=center padding=1>\n";
echo "<tr>
<td><b>ID</b></td>
<td><b>Type</b></td>
<td><b>Reservation Status</b></td>
</tr>\n";
<td width=10%><b>ID</b></td>
<td width=10%><b>Type</b></td>\n";
if ($isadmin) {
echo "<td width=25%><b>Project</b></td>
<td width=25%><b>Experiment</b></td>
<td width=25%><b>Virtual Nickname</b></td>\n";
} else {
echo "<td width=20%><b>Reservation Status</b></td>\n";
}
echo "</tr>\n";
mysql_data_seek($query_result, 0);
while ($r = mysql_fetch_array($query_result)) {
$id = $r["node_id"]; $type = $r["type"];
$res = $r["eid"];
if (!$res || $res == "NULL") {
$res = "--";
$res1 = $r["pid"];
$res2 = $r["eid"];
$res3 = $r["vname"];
if (!$res1 || $res1 == "NULL") {
$res1 = "--";
}
if (!$res2 || $res2 == "NULL") {
$res2 = "--";
}
if (!$res3 || $res3 == "NULL") {
$res3 = "--";
}
echo "<tr><td>$id</td> <td>$type</td> <td>$res</td></tr>\n";
echo "<tr><td>$id</td> <td>$type</td> ";
if ($isadmin) { echo "<td>$res1</td> "; }
echo "<td>$res2</td> ";
if ($isadmin) { echo "<td>$res3</td>"; }
echo "</tr>\n";
}
echo "</table>\n";
......
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