Commit 6cad7e80 authored by Leigh Stoller's avatar Leigh Stoller

Hack up the track stuff so that GENI project members get a pointer to

the protogeni trac in the collab menu. The cross-login will grant
read/write access to the user, no need to worry about having an actual
account on trac anyway.
parent 0ae221fe
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007 University of Utah and the Flux Group.
# Copyright (c) 2007, 2008 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -27,7 +27,7 @@ my $debug = 0;
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $OURDOMAIN = "@OURDOMAIN@";
my $TRACDIR = "/usr/local/www/data/trac";
my $TRACDIR = "/usr/local/www/data/trac/protogeni";
my $TRACPASSWD = "$TRACDIR/.htpasswd";
my $TRACADMIN = "/usr/local/bin/trac-admin";
my $TRACUSER = "nobody";
......@@ -94,7 +94,7 @@ my $uri = `grep mysql: $TRACDIR/conf/trac.ini`;
if ($?) {
fatal("Could not get mysql data from $TRACDIR/conf/trac.ini");
}
if ($uri =~ /mysql:\/\/(\w*):(\w*)\@localhost\/(\w*)$/) {
if ($uri =~ /mysql:\/\/(\w*):(\w*)\@localhost\/([\+\w]*)$/) {
$dbname = $3;
$dbuser = $1;
$dbpass = $2;
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -16,7 +16,14 @@ $this_user = CheckLoginOrDie(CHECKLOGIN_USERSTATUS|
CHECKLOGIN_WEBONLY|CHECKLOGIN_WIKIONLY);
$uid = $this_user->uid();
$TRACURL = "https://${USERNODE}/trac";
$geniproject = Project::Lookup("geni");
$approved = 0;
if (! ($geniproject &&
$geniproject->IsMember($this_user, $approved) && $approved)) {
USERERROR("You do not have permission to access the Trac wiki!", 1);
}
$TRACURL = "https://${USERNODE}/trac/protogeni";
$TRACCOOKIENAME = "trac_auth";
#
......
......@@ -294,7 +294,7 @@ function WRITESIDEBAR() {
global $login_status, $login_user, $pid, $gid;
global $TBBASE, $TBDOCBASE, $BASEPATH, $WIKISUPPORT, $MAILMANSUPPORT;
global $BUGDBSUPPORT, $BUGDBURL, $CVSSUPPORT, $CHATSUPPORT, $TRACSUPPORT;
global $CHECKLOGIN_WIKINAME;
global $CHECKLOGIN_WIKINAME, $TBMAINSITE;
global $THISHOMEBASE;
global $EXPOSETEMPLATES;
global $currentusage, $FANCYBANNER, $ELABINELAB, $PLABSUPPORT;
......@@ -682,9 +682,15 @@ function WRITESIDEBAR() {
NavMenuButton("My Chat Buddies",
"$TBBASE/" . CreateURL("mychat", $login_user));
}
if ($TRACSUPPORT && STUDLY()) {
NavMenuButton("Trac Management",
"$TBBASE/" . CreateURL("gototrac", $login_user));
if ($TBMAINSITE && $TRACSUPPORT) {
$geniproject = Project::Lookup("geni");
$approved = 0;
if ($geniproject &&
$geniproject->IsMember($login_user, $approved) && $approved) {
NavMenuButton("Trac Management",
"$TBBASE/" . CreateURL("gototrac", $login_user));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment