showproject.php3 2.92 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
5
6
# All rights reserved.
#
7
include("defs.php3");
8
include("showstuff.php3");
9

10
11
12
13
14
15
#
# Standard Testbed Header
#
PAGEHEADER("Show Project Information");


16
17
18
19
20
21
22
23
24
25
#
# Note the difference with which this page gets it arguments!
# I invoke it using GET arguments, so uid and pid are are defined
# without having to find them in URI (like most of the other pages
# find the uid).
#

#
# Only known and logged in users can end experiments.
#
26
$uid = GETLOGIN();
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
LOGGEDINORDIE($uid);

$isadmin = ISADMIN($uid);

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

#
# Check to make sure thats this is a valid PID.
#
42
43
if (! TBValidProject($pid)) {
    USERERROR("The project '$pid' is not a valid project.", 1);
44
45
46
}

#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
47
# Verify that this uid is a member of the project being displayed.
48
#
49
50
if (! TBProjAccessCheck($uid, $pid, $pid, $TB_PROJECT_READINFO)) {
    USERERROR("You are not a member of Project $pid.", 1);
51
52
}

53
54
55
56
SUBPAGESTART();
SUBMENUSTART("Project Options");
WRITESUBMENUBUTTON("Create Subgroup",
		   "newgroup_form.php3?pid=$pid");
57
58
WRITESUBMENUBUTTON("Edit User Privs",
		   "editgroup_form.php3?pid=$pid&gid=$pid");
59
60
WRITESUBMENUBUTTON("Remove Users",
		   "showgroup.php3?pid=$pid&gid=$pid");
61
62
WRITESUBMENUBUTTON("Show Project History",
		   "showstats.php3?showby=project&which=$pid");
63
64
WRITESUBMENUBUTTON("Free Node Summary",
		   "nodecontrol_list.php3?showtype=summary&bypid=$pid");
65
SUBMENUEND();
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
SHOWPROJECT($pid, $uid);
SUBPAGEEND();

echo "<center>\n";
echo "<table border=0 bgcolor=#000 color=#000 class=stealth>\n";
echo "<tr valign=top><td class=stealth align=center>\n";

#
# A list of project members (from the default group).
#
SHOWGROUPMEMBERS($pid, $pid, 0);

echo "</td><td align=center class=stealth>\n";

#
# A list of project Groups
#
echo "<h3>Project Groups</h3>\n";
84

Leigh B. Stoller's avatar
Leigh B. Stoller committed
85
86
$query_result =
    DBQueryFatal("SELECT * FROM groups WHERE pid='$pid'");
87
88
89
echo "<table align=center border=1>\n";
echo "<tr>
          <th>GID</th>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
90
          <th>Description</th>
91
92
93
94
95
96
97
          <th>Leader</th>
      </tr>\n";

while ($row = mysql_fetch_array($query_result)) {
    $gid      = $row[gid];
    $desc     = stripslashes($row[description]);
    $leader   = $row[leader];
Leigh B. Stoller's avatar
Leigh B. Stoller committed
98
99

    echo "<tr>
100
101
102
              <td><A href='showgroup.php3?pid=$pid&gid=$gid'>$gid</a></td>
              <td>$desc</td>
              <td><A href='showuser.php3?target_uid=$leader'>$leader</A></td>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
103
104
          </tr>\n";
}
105
echo "</table>\n";
106
echo "</td></table>\n";
107
echo "</center>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
108

109
110
111
#
# A list of project experiments.
#
112
SHOWEXPLIST("PROJ", $uid, $pid);
113

114
115
116
117
118
119
120
121
if ($isadmin) {
    echo "<center>
          <h3>Project Stats</h3>
         </center>\n";

    SHOWPROJSTATS($pid);
}

122
123
124
125
126
if ($isadmin) {
    echo "<p>
          <A href='deleteproject.php3?pid=$pid'>
             <font color=Red>Delete this project?</font></a>\n";
}
127
128
129
130
131

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