shownode.php3 1.29 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
2
3
4
5
6
7
8
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
<?php
include("defs.php3");
include("showstuff.php3");

#
# Standard Testbed Header
#
PAGEHEADER("Node Information");

#
# Only known and logged in users can do this.
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
$isadmin = ISADMIN($uid);

#
# Verify form arguments.
# 
if (!isset($node_id) ||
    strcmp($node_id, "") == 0) {
    USERERROR("You must provide a node ID.", 1);
}

#
# Check to make sure that this is a valid nodeid
#
$query_result =
    DBQueryFatal("SELECT node_id 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);
}

#
# Admin users can look at any node, but normal users can only control
# nodes in their own experiments.
#
if (! $isadmin) {
    if (! TBNodeAccessCheck($uid, $node_id, $TB_NODEACCESS_MODIFYINFO)) {
        USERERROR("You do not have permission to modify node $node_id!", 1);
    }
}

#
# Dump record.
# 
SHOWNODE($node_id);

#
# Edit option
#
echo "<p><center>
           Do you want to edit this the node info?
           <A href='nodecontrol_form.php3?node_id=$node_id'>Yes</a>
         </center>\n";

57
58
59
60
61
62
63
if ($isadmin) {
    echo "<br><p>
          <center>
            <A href='shownodelog.php3?node_id=$node_id'>Node Log</a>
          </center>\n";
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
64
65
66
67
68
#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>