archive_view.php3 2.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
include("showstuff.php3");

#
# Only known and logged in users can look at experiments.
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
$isadmin = ISADMIN($uid);

#
# Verify page arguments.
#
20 21 22 23 24
if (isset($exptidx) && $exptidx != "") {
    if (!TBvalid_integer($exptidx)) {
	PAGEARGERROR("Invalid experiment index.");
    }
    PAGEHEADER("Experiment Archive ($exptidx)");
25

26 27 28 29
    unset($pid);
    unset($eid);
    unset($gid);
    TBExptidx2PidEid($exptidx, $pid, $eid, $gid);
30

31 32
    $url = preg_replace("/archive_view/", "cvsweb/cvsweb",
			$_SERVER['REQUEST_URI']);
33
}
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
else {
    if (!isset($pid) ||
	strcmp($pid, "") == 0) {
	USERERROR("You must provide a Project ID.", 1);
    }
    if (!isset($eid) ||
	strcmp($eid, "") == 0) {
	USERERROR("You must provide an Experiment ID.", 1);
    }
    if (!TBvalid_pid($pid)) {
	PAGEARGERROR("Invalid project ID.");
    }
    if (!TBvalid_eid($eid)) {
	PAGEARGERROR("Invalid experiment ID.");
    }
49

50 51 52 53 54 55 56 57 58 59 60 61 62 63
    #
    # Check to make sure this is a valid PID/EID tuple.
    #
    if (! TBValidExperiment($pid, $eid)) {
	USERERROR("The experiment $eid is not a valid experiment ".
		  "in project $pid.", 1);
    }
    $exptidx = TBExptIndex($pid, $eid);
    if ($exptidx < 0) {
	TBERROR("Could not get experiment index for $pid/$eid!", 1);
    }
    PAGEHEADER("Experiment Archive ($pid/$eid)");
    
    $url = "cvsweb/cvsweb.php3/${exptidx}?exptidx=$exptidx";
64 65
}

66 67 68
# This is how you get forms to align side by side across the page.
$style = 'style="float:left; width:33%;"';

69
echo "<center>\n";
70 71
echo "<font size=+1>
        This is the Subversion archive for your experiment.<br></font>";
72 73 74 75 76 77 78 79 80
if (isset($pid)) {
    echo "<form action='${TBBASE}/archive_tag.php3' $style method=get>\n";
    echo "<b><input type=submit name=tag value='Tag Archive'></b>";
    echo "<input type=hidden name=pid value='$pid'>";
    echo "<input type=hidden name=eid value='$eid'>";
    echo "</form>";
}

echo "<form action='${TBBASE}/archive_tags.php3' $style method=get>";
81 82 83
echo "<b><input type=submit name=tag value='Show Tags'></b>";
echo "<input type=hidden name=which value='$exptidx'>";
echo "</form>";
84 85 86

if (isset($pid)) {
echo "<form action='${TBBASE}/archive_missing.php3' $style method=get>";
87 88 89 90
echo "<b><input type=submit name=missing value='Show Missing Files'></b>";
echo "<input type=hidden name=pid value='$pid'>";
echo "<input type=hidden name=eid value='$eid'>";
echo "</form>";
91
} 
92 93 94 95 96 97 98 99 100 101
echo "</center>\n";

echo "<iframe width=100% height=800 scrolling=yes src='$url' border=2>".
     "</iframe>\n";

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