nodecontrol_form.php3 2.58 KB
Newer Older
1 2 3
<?php
include("defs.php3");

4 5 6 7 8
#
# Standard Testbed Header
#
PAGEHEADER("Node Control Form");

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
#
# Only known and logged in users can do this.
#
LOGGEDINORDIE($uid);

#
# Admin users can control other nodes.
#
$isadmin = ISADMIN($uid);
if (! $isadmin) {
    USERERROR("You do not have admin privledges!", 1);
}

echo "<center><h1>
      Node Control Center: $node_id
      </h1></center>";

#
# Check to make sure thats this is a valid nodeid
#
$query_result = mysql_db_query($TBDBNAME,
	"SELECT * FROM nodes WHERE node_id=\"$node_id\"");
if (mysql_num_rows($query_result) == 0) {
  USERERROR("The node $node_id is not a valid nodeid", 1);
}
$row = mysql_fetch_array($query_result);

$node_id            = $row[node_id]; 
$type               = $row[type];
$def_boot_image_id  = $row[def_boot_image_id];
$def_boot_cmd_line  = $row[def_boot_cmd_line];
$next_boot_path     = $row[next_boot_path];
$next_boot_cmd_line = $row[next_boot_cmd_line];

echo "<table border=2 cellpadding=0 cellspacing=2
       align='center'>\n";

#
# Generate the form.
# 
echo "<form action=\"nodecontrol.php3?uid=$uid\" method=\"post\">\n";

echo "<tr>
          <td>Node ID:</td>
          <td class=\"left\"> 
              <input type=\"readonly\" name=\"node_id\" value=\"$node_id\">
              </td>
      </tr>\n";

echo "<tr>
          <td>Node Type:</td>
          <td class=\"left\"> 
              <input type=\"readonly\" name=\"node_type\" value=\"$type\">
              </td>
      </tr>\n";

#
# This should be a menu.
# 
echo "<tr>
          <td>Def Boot Image:</td>
          <td class=\"left\">
              <input type=\"text\" name=\"def_boot_image_id\" size=\"20\"
                     value=\"$def_boot_image_id\"></td>
      </tr>\n";

echo "<tr>
          <td>Def Boot Command Line:</td>
          <td class=\"left\">
              <input type=\"text\" name=\"def_boot_cmd_line\" size=\"40\"
                     value=\"$def_boot_cmd_line\"></td>
      </tr>\n";


echo "<tr>
          <td>Next Boot Path:</td>
          <td class=\"left\">
              <input type=\"text\" name=\"next_boot_path\" size=\"40\"
                     value=\"$next_boot_path\"></td>
      </tr>\n";


echo "<tr>
          <td>Next Boot Command Line:</td>
          <td class=\"left\">
              <input type=\"text\" name=\"next_boot_cmd_line\" size=\"40\"
                     value=\"$next_boot_cmd_line\"></td>
      </tr>\n";


echo "<tr>
          <td colspan=2 align=center>
              <b><input type=\"submit\" value=\"Submit\"></b>
          </td>
     </tr>
     </form>
     </table>\n";

107 108 109 110 111
#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>