showproject.php3 2.6 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
#
# Standard Testbed Header
#
PAGEHEADER("Show Project Information");


16 17 18 19 20 21 22 23
#
# 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).
#

#
24
# Only known and logged in users.
25
#
26 27 28
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
29 30

#
31
# Verify page arguments.
32
#
33 34 35 36
$reqargs  = RequiredPageArguments("project", PAGEARG_PROJECT);
$project  = $reqargs["project"];
$group    = $project->Group();
$pid      = $project->pid();
37 38

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

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

65
SUBMENUEND();
66 67 68 69

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

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

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

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

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

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

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

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

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

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

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