Commit 30c0cff3 authored by Leigh Stoller's avatar Leigh Stoller

Clean up the DirectoryIndex mess.

* Remove DirectoryIndex from the .htaccess file. This file set the
  index for every directory to start.php3, which was wrong.

* Change index.html to redirect to index.php3.

* Change start.php3 to redirect to index.php3. I left the start.php3
  script in place (one line script) so that existing bookmarks work.

* Move the code that used to be in start.php3 to the top of
  index.php3; this is the code that would zap to the My Emulab page
  when the user was logged in (and in https mode). Much simpler now.
parent ef0a0886
......@@ -4,6 +4,3 @@ ErrorDocument 404 /error.php3
ErrorDocument 403 /error.php3
Redirect /tutorial.html http://www.emulab.net/sc2002tut.php3
DirectoryIndex start.php3
<!--
EMULAB-COPYRIGHT
Copyright (c) 2000-2002 University of Utah and the Flux Group.
Copyright (c) 2000-2004 University of Utah and the Flux Group.
All rights reserved.
-->
<!--- THIS FILE IS DEPRECATED! DO NOT DELETE THOUGH! SEE THE .htaccess FILE -->
<!--- THIS FILE IS DEPRECATED! DO NOT DELETE THOUGH! SEE THE .htaccess FILE -->
<!--- THIS FILE IS DEPRECATED! DO NOT DELETE THOUGH! SEE THE .htaccess FILE -->
<!--- This exists to redirect to the PHP script -->
<html>
<head>
<title>Emulab.Net</title>
<META HTTP-EQUIV="Refresh" Content= "0; URL=start.php3">
<META HTTP-EQUIV="Refresh" Content= "0; URL=index.php3">
</head>
</html>
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
#
# The point of this is to redirect logged in users to their My Emulab
# page.
#
if (($uid = GETUID())) {
$check_status = CHECKLOGIN($uid) & CHECKLOGIN_STATUSMASK;
if ($check_status == CHECKLOGIN_LOGGEDIN) {
# Zap to My Emulab page.
header("Location: $TBBASE/showuser.php3?target_uid=$uid");
return;
}
elseif (isset($SSL_PROTOCOL)) {
# Fall through; display the page.
;
}
elseif ($check_status == CHECKLOGIN_MAYBEVALID) {
# Not in SSL mode, so reload using https to see if really logged in.
header("Location: $TBBASE/index.php3");
}
# Fall through; display the page.
}
#
# Standard Testbed Header
#
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
# This page used to be the front script, but it now just redirects to
# index.php3.
#
# Beware empty spaces (cookies)!
#
# 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.
#
require("defs.php3");
if (($uid = GETUID())) {
$check_status = CHECKLOGIN($uid) & CHECKLOGIN_STATUSMASK;
if ($check_status == CHECKLOGIN_LOGGEDIN) {
$LOC = "$TBBASE/showuser.php3?target_uid=$uid";
}
elseif (isset($SSL_PROTOCOL)) {
$LOC = "$TBBASE/index.php3";
}
elseif ($check_status == CHECKLOGIN_MAYBEVALID) {
$LOC = "$TBBASE/start.php3";
}
else
$LOC = "$TBDOCBASE/index.php3";
}
elseif (isset($SSL_PROTOCOL)) {
$LOC = "$TBBASE/index.php3";
}
else {
$LOC = "$TBDOCBASE/index.php3";
}
header("Location: $LOC");
header("Location: index.php3");
?>
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