Commit d047107c authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

A set of change to allow redirecting user to his profile after logging

in. This was mostly to support the modal change in the home link, but
since people do not like that, this stuff is probably going to get
tossed at some point.
parent 65846a01
......@@ -41,7 +41,10 @@ else {
if ($login_status == $STATUS_LOGGEDIN) {
header("Location: " . "index.php3");
# Zap back to front page in secure mode.
header("Location: $TBBASE/");
......@@ -73,11 +73,17 @@ function WRITESIDEBAR() {
$freepcs = TBFreePCs();
echo "<tr>
<td height=30 valign=center align=center nowrap>
<b><span class=sidebarbutton>
Web Interface Options
Web Interface Options\n";
if ($login_status == $STATUS_LOGGEDIN) {
echo " <br>($freepcs Free PCs)\n";
echo " </span>
......@@ -274,7 +280,7 @@ function WRITEBANNER($title) {
echo "<!-- This is the page Banner -->\n";
echo "<table cellpadding=0 cellspacing=0 border=0 bgcolor=$BANNERCOLOR>";
echo "<table cellpadding=0 cellspacing=0 border=0>";
echo "<tr>
<td align=left width=\"0%\">
<table cellpadding=5 cellspacing=0 border=0 bgcolor=\"#880000\">
......@@ -2,17 +2,39 @@
# Beware empty spaces (cookies)!
# The point of this file is so that when people go to
# they will be redirected from to
#, so that we can force certain traffic
# through the secure server instead of the plain server.
# The point of this mess is to redirect people from the top level
# index page (ie: no page specified) to the most appropriate page.
# 1. If no UID cookie comes in from the browser, just redirect to the
# to the index page, maintaining secure/insecure mode. That is, if the
# page was accessed via https, use https when redirecting to the index
# page.
# 2. If a UID cookie comes in, check to see if the user is logged in. If
# so, redirect to his user information page. If the user is logged in,
# but came in with http, then we cannot actually confirm it (MAYBEVALID),
# since the hash cookie will not be sent along, so we redirect back using
# https so that we can confirm it (hash cookie sent). If it turns out that
# the user is not logged in, fall back to #1 above.
# We want to redirect to emulab, not paper. This needs to be fixed!
if (isset($SSL_PROTOCOL)) {
if (($uid = GETUID())) {
$check_status = CHECKLOGIN($uid);
if ($check_status == $CHECKLOGIN_LOGGEDIN) {
$LOC = "$TBBASE/showuser.php3?target_uid=$uid";
elseif ($check_status == $CHECKLOGIN_MAYBEVALID) {
$LOC = "$TBBASE/start.php3";
elseif (isset($SSL_PROTOCOL)) {
$LOC = "$TBBASE/index.php3";
$LOC = "$TBDOCBASE/index.php3";
elseif (isset($SSL_PROTOCOL)) {
$LOC = "$TBBASE/index.php3";
else {
......@@ -20,5 +42,4 @@ else {
header("Location: $LOC");
Supports Markdown
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