showproject.php3 2.58 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2 3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2007 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_once("template_defs.php");
9 10 11 12 13 14 15 16 17

#
# 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).
#

#
18
# Only known and logged in users.
19
#
20 21 22
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
23 24

#
25
# Verify page arguments.
26
#
27 28 29 30
$reqargs  = RequiredPageArguments("project", PAGEARG_PROJECT);
$project  = $reqargs["project"];
$group    = $project->Group();
$pid      = $project->pid();
31

32 33 34 35 36
#
# Standard Testbed Header
#
PAGEHEADER("Project $pid");

37
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
38
# Verify that this uid is a member of the project being displayed.
39
#
40
if (! $project->AccessCheck($this_user, $TB_PROJECT_READINFO)) {
41
    USERERROR("You are not a member of Project $pid.", 1);
42 43
}

44 45 46
SUBPAGESTART();
SUBMENUSTART("Project Options");
WRITESUBMENUBUTTON("Create Subgroup",
47
		   "newgroup.php3?pid=$pid");
48 49
WRITESUBMENUBUTTON("Edit User Privs",
		   "editgroup_form.php3?pid=$pid&gid=$pid");
50 51
WRITESUBMENUBUTTON("Remove Users",
		   "showgroup.php3?pid=$pid&gid=$pid");
52
WRITESUBMENUBUTTON("Show Project History",
53
		   "showstats.php3?showby=project&pid=$pid");
54 55
WRITESUBMENUBUTTON("Free Node Summary",
		   "nodecontrol_list.php3?showtype=summary&bypid=$pid");
Leigh B. Stoller's avatar
Leigh B. Stoller committed
56 57 58 59
if ($isadmin) {
    WRITESUBMENUDIVIDER();
    WRITESUBMENUBUTTON("Delete this project",
		       "deleteproject.php3?pid=$pid");
60 61
    WRITESUBMENUBUTTON("Resend Approval Message",
		       "resendapproval.php?pid=$pid");
Leigh B. Stoller's avatar
Leigh B. Stoller committed
62 63
}

64
SUBMENUEND();
65 66 67 68

#
# Show number of PCS
#
69
$numpcs = $project->PCsInUse();
70 71 72 73 74 75 76

if ($numpcs) {
    echo "<center><font color=Red size=+2>\n";
    echo "Project $pid is using $numpcs PCs!\n";
    echo "</font></center>\n";
}

77
$project->Show();
78 79 80 81 82 83 84 85 86
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).
#
87
$group->ShowMembers();
88 89 90 91 92 93

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

#
# A list of project Groups
#
94 95
$project->ShowGroupList();

96
echo "</td></table>\n";
97
echo "</center>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
98

99 100 101 102 103
# Project wide Templates.
if ($EXPOSETEMPLATES) {
    SHOWTEMPLATELIST("PROJ", 0, $uid, $pid);
}

104 105 106
#
# A list of project experiments.
#
107
ShowExperimentList("PROJ", $this_user, $project);
108

109 110 111 112 113
if ($isadmin) {
    echo "<center>
          <h3>Project Stats</h3>
         </center>\n";

114
    $project->ShowStats();
115 116
}

117 118 119 120
#
# Standard Testbed Footer
# 
PAGEFOOTER();
121
?>