Commit 14512a88 authored by Leigh Stoller's avatar Leigh Stoller

Use the new trac ticket system for "reporting bugs, gripes, requests".

Also some changes to cross machine login to trac to avoid repeated
cookie generation.
parent 70f550ec
......@@ -19,6 +19,7 @@
import string
import re
import os
from trac import perm, util
from trac.core import *
......@@ -56,7 +57,11 @@ class EmulabAuthModule(auth.LoginModule):
req.redirect(self.env.abs_href())
return
auth.LoginModule._do_login(self, req)
req.redirect(self.env.abs_href())
if req.args.get('goto'):
req.redirect(self.env.abs_href() + req.args.get('goto'))
else:
req.redirect(self.env.abs_href())
pass
pass
elif req.path_info.startswith('/logout'):
auth.LoginModule._do_logout(self, req)
......@@ -128,6 +133,10 @@ class EmulabAuthModule(auth.LoginModule):
yield ('metanav', 'login', 'logged in as %s' % req.authname)
yield ('metanav', 'logout',
html.A('Logout', href=req.href.logout()))
else:
shortname = os.path.basename(self.env.path)
url = 'https://www.emulab.net/gototrac.php3?login=1&wiki=%s' % shortname
yield ('metanav', 'login', html.A('Login', href=url))
pass
pass
......
......@@ -20,10 +20,15 @@ $uid = $this_user->uid();
# Verify page arguments. project_title is the project to zap to.
#
$optargs = OptionalPageArguments("wiki", PAGEARG_STRING,
"force", PAGEARG_BOOLEAN);
"login", PAGEARG_BOOLEAN,
"do", PAGEARG_STRING);
if (!isset($wiki)) {
$wiki = "emulab";
}
if (!isset($login)) {
$login = 0;
}
if ($wiki == "geni") {
$geniproject = Project::Lookup("geni");
......@@ -48,8 +53,12 @@ else {
# Look for our cookie. If the browser has it, then there is nothing
# more to do; just redirect the user over to the wiki.
#
if (!isset($force) && isset($_COOKIE[$TRACCOOKIENAME])) {
header("Location: ${TRACURL}");
if (!$login) {
$url = ${TRACURL};
if (isset($do)) {
$url .= "/" . $do;
}
header("Location: ${url}");
return;
}
......@@ -68,6 +77,6 @@ if ($wiki == "protogeni") {
# We do this for the private wiki. Temporary.
setcookie($TRACCOOKIENAME, $hash, 0, "/", $TBAUTHDOMAIN, $TBSECURECOOKIES);
}
header("Location: ${TRACURL}/xlogin?user=$uid&hash=$hash");
header("Location: ${TRACURL}/xlogin?user=$uid&hash=$hash" .
(isset($do) ? "&goto=/${do}" : ""));
?>
......@@ -1176,8 +1176,7 @@ function PAGEFOOTER($view = NULL) {
if ($login_user) {
echo " <td class=reportbug>";
echo " <a href='$TBBASE/gotobugdb.php3".
"?do=newtask&project_title=Emulab'>";
echo " <a href='$TBBASE/gototrac.php3?do=newticket&login=1'>";
echo " Report Bug, Gripe, Request Feature</a>";
echo " </td>";
}
......
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