showproject.php3 2.91 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2 3
#
# EMULAB-COPYRIGHT
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# Copyright (c) 2000-2006 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");
Leigh B. Stoller's avatar
Leigh B. Stoller committed
65 66 67 68 69 70
if ($isadmin) {
    WRITESUBMENUDIVIDER();
    WRITESUBMENUBUTTON("Delete this project",
		       "deleteproject.php3?pid=$pid");
}

71
SUBMENUEND();
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
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";
90

Leigh B. Stoller's avatar
Leigh B. Stoller committed
91 92
$query_result =
    DBQueryFatal("SELECT * FROM groups WHERE pid='$pid'");
93 94 95
echo "<table align=center border=1>\n";
echo "<tr>
          <th>GID</th>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
96
          <th>Description</th>
97 98 99 100 101 102 103
          <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
104 105

    echo "<tr>
106 107 108
              <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
109 110
          </tr>\n";
}
111
echo "</table>\n";
112
echo "</td></table>\n";
113
echo "</center>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
114

115 116 117
#
# A list of project experiments.
#
118
SHOWEXPLIST("PROJ", $uid, $pid);
119

120 121 122 123 124 125 126 127
if ($isadmin) {
    echo "<center>
          <h3>Project Stats</h3>
         </center>\n";

    SHOWPROJSTATS($pid);
}

128 129 130 131
#
# Standard Testbed Footer
# 
PAGEFOOTER();
132
?>