shownode.php3 1.82 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
3
4
5
6
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# All rights reserved.
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
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
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
#
33
34
if (! TBValidNodeName($node_id)) {
    USERERROR("$node_id is not a valid node name!", 1);
Leigh B. Stoller's avatar
Leigh B. Stoller committed
35
36
37
38
39
40
41
42
43
44
45
46
}

#
# 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);
    }
}

47
48
SUBPAGESTART();
SUBMENUSTART("Node Options");
Leigh B. Stoller's avatar
Leigh B. Stoller committed
49

Chad Barb's avatar
Chad Barb committed
50
51
52
53
54
55
56
57
58
59
#
# Tip to node option
#
if ($isadmin || 
    TBNodeAccessCheck($uid, $node_id, $TB_NODEACCESS_MODIFYINFO)) {
    WRITESUBMENUBUTTON("Connect to Serial Line</a> " . 
	"<a href=\"faq.php3#UTT-TUNNEL\">(howto)",
	"nodetipacl.php3?node_id=$node_id");
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
60
61
62
#
# Edit option
#
Chad Barb's avatar
Chad Barb committed
63
WRITESUBMENUBUTTON("Edit Node Info",
64
		   "nodecontrol_form.php3?node_id=$node_id");
Leigh B. Stoller's avatar
Leigh B. Stoller committed
65

66
67
68
69
70
if (TBNodeAccessCheck($uid, $node_id, $TB_NODEACCESS_REBOOT)) {
    WRITESUBMENUBUTTON("Reboot Node",
		       "boot.php3?node_id=$node_id");
}

71
if ($isadmin) {
72
73
74
75
    WRITESUBMENUBUTTON("Access Node Log",
		       "shownodelog.php3?node_id=$node_id");
    WRITESUBMENUBUTTON("Free Node",
		       "freenode.php3?node_id=$node_id");
76
}
77
78
SUBMENUEND();

Chad Barb's avatar
Chad Barb committed
79
80
# echo "<h4>(<a href=\"faq.php3#UTT-TUNNEL\">Help on 'connect to serial line'</a>)</h4>";

81
82
83
84
85
86
#
# Dump record.
# 
SHOWNODE($node_id);

SUBPAGEEND();
87

Leigh B. Stoller's avatar
Leigh B. Stoller committed
88
89
90
91
92
#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>
Chad Barb's avatar
Chad Barb committed
93
94
95
96