listrepos.php3 4.22 KB
Newer Older
1 2
<?php
#
3
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#
include("defs.php3");

if (!$CVSSUPPORT) {
    header("Location: index.php3");
    return;
}

#
# Standard Testbed Header is below.
#

#
# Only known and logged in users.
#
38 39 40
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
41 42

#
43
# Verify page arguments.
44
#
45 46 47
$reqargs = RequiredPageArguments("target_user", PAGEARG_USER);

# Need these below.
48 49 50
$userstatus = $target_user->status();
$target_uid = $target_user->uid();

51 52 53
#
# Standard Testbed Header, now that we know what we want to say.
#
54
if ($uid != $target_uid) {
55 56 57 58 59 60 61 62 63
    PAGEHEADER("CVS Repositories for: $target_uid");
}
else {
    PAGEHEADER("My CVS Repositories");
}

#
# Verify Permission.
#
64 65 66
if (!$isadmin && 
    !$target_user->AccessCheck($this_user, $TB_USERINFO_READINFO)) {
    USERERROR("You do not have permission to view ${uid}'s information!", 1);
67 68 69 70 71
}

#
# See what projects the uid is a member of, and print some repo pointers
#
72
$projlist = $target_user->ProjectAccessList($TB_PROJECT_READINFO);
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

if (! count($projlist)) {
    USERERROR("$target_uid is not a member of any Projects!", 1);
}

echo "<br>
      <center><font size=+1>
      CVS repositories for the projects you are a member of</font><br>
      (Click on the CvsWeb link to visit the repository)
      </font></center><br>\n";

echo "<table align=center cellpadding=2 border=1>\n";
echo "<tr>
        <th>Project</th>
        <th>Repository</th>
        <th>CvsWeb Link</th>
      </tr>\n";

while (list($pid) = each($projlist)) {
    $cvsdir = "$TBCVSREPO_DIR/$pid";
93
    $cvsurl = "cvsweb/cvswebwrap.php3?pid=$pid";
94 95 96 97 98 99 100 101 102 103 104
	
    echo "<tr>
              <td><A href='showproject.php3?pid=$pid'>$pid</A></td>
              <td>$cvsdir</td>
              <td align=center><A href='$cvsurl'>
                     <img src=\"arrow4.ico\"
                          border=0 alt='cvsrepo'></A></td>
          </tr>\n";
}
echo "</table>\n";

105
if ($target_user->cvsweb()) {
106 107
    echo "<br><center>
          You also have CVSweb access to the
108
          <a href=cvsweb/cvswebwrap.php3>Emulab Source Repository</a>.
109 110 111 112 113 114 115 116 117 118 119 120
          </center><br>\n";
          
}

echo "<blockquote><blockquote>
      Emulab gives each project its own CVS repository in $TBCVSREPO_DIR.
      The repository is available both via FreeBSD's
      <a hrep=http://www.freebsd.org/projects/cvsweb.html>CVSweb</a>
      interface, and via
      <a href=http://www.freebsd.org/cgi/man.cgi?query=cvs&sektion=1>CVS</a>
      over
      <a href=http://www.freebsd.org/cgi/man.cgi?query=ssh&sektion=1>SSH</a>
121
      to <tt>$CVSNODE</tt>.<br>
122 123 124 125 126 127
      <br>
      Project CVS repositories are initially <b>private</b>; only members
      of the project may access the repository. Repositories may also be
      set to <b>public</b> via a toggle on the project home page. When a
      repository is set to public, anyone on the Internet may access the
      repository (read-only), either with the CVSWeb interface, or with
128
      anonymous CVS using CVS's pserver, both hosted on <tt>$CVSNODE</tt>.
129 130 131
      <br><br>
      When a project repository <b>is</b> public, the CVSweb address is:
      <blockquote>
132
      <tt>http://$CVSNODE/cvsweb/cvsweb.cgi/?cvsroot=yourprojectname</tt>
133 134 135
      </blockquote>
      or you can use CVS pserver with:
      <blockquote>
136
      <tt>cvs -R -d :pserver:anoncvs@$CVSNODE:/cvsrepos/yourprojectname ...
137 138 139 140 141 142 143 144 145 146
        </tt>
      </blockquote>
      just hit carriage return for the password.
      </blockquote></blockquote>\n";

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