newnodelog_form.php3 2.64 KB
Newer Older
1
<?php
Leigh Stoller's avatar
Leigh Stoller committed
2
#
3
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Leigh Stoller's avatar
Leigh Stoller committed
23
#
24
include("defs.php3");
25
include_once("node_defs.php");
26 27 28 29

#
# Only known and logged in users can do this.
#
30 31 32
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
33 34

#
35 36 37
# Verify page arguments.
#
$optargs = OptionalPageArguments("node", PAGEARG_NODE);
38 39

#
40 41
# Only Admins can enter log entries. Or members of emulab-ops project
# if the node is free or reserved to emulab-ops.
42
#
43
if (! ($isadmin || OPSGUY())) {
44 45 46
    USERERROR("You do not have permission to enter log entries!", 1);
}

47 48 49 50 51
#
# Standard Testbed Header
#
PAGEHEADER("Enter Node Log Entry");

52 53 54 55 56 57 58 59 60 61 62 63 64
echo "<table align=center border=1> 
      <tr>
         <td align=center colspan=2>
             <em>(Fields marked with * are required)</em>
         </td>
      </tr>
     <form action='newnodelog.php3' method=post>\n";

#
# Node ID:
#
# Note DB max length.
#
65
if (isset($node)) {
66 67
    echo "<tr>
              <td>*Node ID:</td>
68 69 70
              <td><input type=text name=node_id
                         value=" . $node->node_id() . " 
	                 size=$TBDB_NODEIDLEN maxlength=$TBDB_NODEIDLEN>
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 107 108 109 110 111 112 113 114
      </tr>\n";
}
else {
    echo "<tr>
              <td>*Node ID:</td>
              <td><input type=text name=node_id size=$TBDB_NODEIDLEN
                         maxlength=$TBDB_NODEIDLEN>
              </td>
      </tr>\n";
}

#
# Log Type.
#
echo "<tr>
          <td>*Log Type:</td>
          <td><select name=log_type>
               <option selected value='misc'>Misc</option>
              </select>
          </td>
      </tr>\n";

#
# Log Entry.
#
echo "<tr>
         <td>*Log Entry:</td>
         <td><input type=text name=log_entry size=50 maxlength=128></td>
      </tr>\n";

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

echo "</form>
      </table>\n";

#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>