Commit d1bb0a9c authored by Mike Hibler's avatar Mike Hibler

Fix up a number of places where we were assuming "register_globals=yes".

That option is no longer supported as of PHP 5.4.
parent 4af55ad5
......@@ -22,9 +22,7 @@ if (!isset($SAJAX_INCLUDED)) {
}
function sajax_get_my_uri() {
global $REQUEST_URI;
return $REQUEST_URI;
return $_SERVER["REQUEST_URI"];
}
$sajax_remote_uri = sajax_get_my_uri();
......
<?php
#
# Copyright (c) 2000-2007, 2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -64,7 +64,7 @@ PAGEHEADER("NetBuild");
<param name='uid'
value="<?php echo $uid?>">
<param name='auth'
value="<?php echo $HTTP_COOKIE_VARS[$TBAUTHCOOKIE]?>">
value="<?php echo $_COOKIE[$TBAUTHCOOKIE]?>">
<param name='expcreateurl'
value="<?php echo $TBBASE?>/beginexp.php">
<?php
......
<?php
#
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -73,12 +73,12 @@ slice1_md5=d326a1f604489c43b488fa80a88221f4\n" . $slicexbase;
#
function SPITSTATUS($status)
{
global $REMOTE_ADDR, $REQUEST_URI;
header("Content-Type: text/plain");
echo "emulab_status=$status\n";
if ($status) {
$REQUEST_URI = $_SERVER["REQUEST_URI"];
$REMOTE_ADDR = $_SERVER["REMOTE_ADDR"];
TBERROR("CDROM Checkin Error ($status) from $REMOTE_ADDR:\n\n".
"$REQUEST_URI\n", 0);
}
......@@ -315,7 +315,7 @@ if (strcmp($privIP, "1.1.1.1")) {
SPITSTATUS(CDROMSTATUS_BADIPADDR);
return;
}
if (strcmp($REMOTE_ADDR, $IP)) {
if (strcmp($_SERVER["REMOTE_ADDR"], $IP)) {
SPITSTATUS(CDROMSTATUS_BADREMOTEIP);
return;
}
......@@ -439,7 +439,7 @@ elseif ($cdvers == 3) {
}
}
elseif ($cdvers == 69) {
if (!strcmp($REMOTE_ADDR, "155.101.132.191")) {
if (!strcmp($_SERVER["REMOTE_ADDR"], "155.101.132.191")) {
echo "fdisk=image.fdisk\n";
echo "fdisk_sig=image.fdisk.sig\n";
echo "slice1_image=slice1.ndz\n";
......
<?php
#
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -163,7 +163,7 @@ app.appendChild(param);
param = document.createElement("param");
param.setAttribute("name", "auth");
param.setAttribute("value", "<?php echo $HTTP_COOKIE_VARS[$TBAUTHCOOKIE]?>");
param.setAttribute("value", "<?php echo $_COOKIE[$TBAUTHCOOKIE]?>");
app.appendChild(param);
if (pid != "" && eid != "") {
......@@ -192,7 +192,7 @@ window.onLoad = resize;
alt='You need java to run this applet'>
<param name="class" value="net.emulab.netlab.client.NetlabClient">
<param name="uid" value="<?php echo $uid?>">
<param name="auth" value="<?php echo $HTTP_COOKIE_VARS[$TBAUTHCOOKIE]?>">
<param name="auth" value="<?php echo $_COOKIE[$TBAUTHCOOKIE]?>">
<?php if (isset($pid)): ?>
<param name='pid' value='{$pid}'>
<?php endif; ?>
......
<?php
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -739,7 +739,7 @@ class Logfile
$maxtries = 3;
$DBlinkid = 0;
while ($maxtries) {
$DBlinkid = mysql_connect("localhost", basename($SCRIPT_NAME));
$DBlinkid = mysql_connect("localhost", basename($_SERVER["SCRIPT_NAME"]));
if ($DBlinkid) {
break;
}
......@@ -761,14 +761,13 @@ $DBlinkids[$TBDBNAME] = $DBlinkid;
#
function DBConnect($dbname)
{
global $SCRIPT_NAME;
global $DBlinkids;
if (array_key_exists($dbname, $DBlinkids)) {
return $DBlinkids[$dbname];
}
$linkid = mysql_connect("localhost", basename($SCRIPT_NAME), "none", 1);
$linkid = mysql_connect("localhost", basename($_SERVER["SCRIPT_NAME"]), "none", 1);
if ($linkid) {
if (!mysql_select_db($dbname, $linkid)) {
return null;
......
......@@ -203,11 +203,10 @@ $session_errorhandler = 0;
function TBMAIL($to, $subject, $message, $headers = 0)
{
global $THISHOMEBASE;
global $SCRIPT_NAME;
$subject = strtoupper($THISHOMEBASE) . ": $subject";
$tag = "X-NetBed: " . basename($SCRIPT_NAME);
$tag = "X-NetBed: " . basename($_SERVER["SCRIPT_NAME"]);
if ($headers) {
$headers = "$headers\n" . $tag;
......
<?php
#
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -80,6 +80,7 @@ if ($printable) {
<body>\n";
}
else {
$REQUEST_URI = $_SERVER["REQUEST_URI"];
echo "<b><a href=$REQUEST_URI&printable=1>
Printable version of this document</a></b><br>\n";
}
......
<?php
#
# Copyright (c) 2000-2002, 2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -31,7 +31,7 @@ RequiredPageArguments();
#
PAGEHEADER("Non Existent Page!");
USERERROR("The URL you gave: <b>" . htmlentities( $REQUEST_URI ) . "</b>
USERERROR("The URL you gave: <b>" . htmlentities( $_SERVER["REQUEST_URI"] ) . "</b>
is not available or is broken.", 1);
#
......
<?php
#
# Copyright (c) 2006-2012 University of Utah and the Flux Group.
# Copyright (c) 2006-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -1060,8 +1060,8 @@ class Experiment
$lockval = ($lockdown ? "Yes" : "No");
echo "<tr>
<td>Locked Down:</td>
<td>$lockval (<a href=toggle.php?pid=$pid&eid=$eid".
"&type=lockdown&value=$lockflip>Toggle</a>)
<td>$lockval (<a href='toggle.php?pid=$pid&eid=$eid".
"&type=lockdown&value=$lockflip'>Toggle</a>)
</td>
</tr>\n";
......@@ -1070,8 +1070,8 @@ class Experiment
$flipval = ($skipvlans ? "Yes" : "No");
echo "<tr>
<td>Skip Vlans:</td>
<td>$flipval (<a href=toggle.php?pid=$pid&eid=$eid".
"&type=skipvlans&value=$thisflip>Toggle</a>)
<td>$flipval (<a href='toggle.php?pid=$pid&eid=$eid".
"&type=skipvlans&value=$thisflip'>Toggle</a>)
</td>
</tr>\n";
}
......
<?php
#
# Copyright (c) 2008 University of Utah and the Flux Group.
# Copyright (c) 2008, 2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -52,6 +52,7 @@ if ($printable) {
<body>\n";
} else {
PAGEHEADER("Bibliography");
$REQUEST_URI = $_SERVER["REQUEST_URI"];
echo "<b><a href=$REQUEST_URI?printable=1>
Printable version of this document</a></b><br>\n";
}
......
<?php
#
# Copyright (c) 2008 University of Utah and the Flux Group.
# Copyright (c) 2008, 2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -56,7 +56,8 @@ if (!$printable) {
}
if (!$printable) {
echo "<b><a href=$REQUEST_URI?printable=1>
$REQUEST_URI = $_SERVER["REQUEST_URI"];
echo "<b><a href='$REQUEST_URI?printable=1'>
Printable version of this document</a></b><br>\n";
}
......
......@@ -724,8 +724,8 @@ class Image
$globalflip = ($globalid ? 0 : 1);
$globalval = ($globalid ? "Yes" : "No");
echo "$globalval (<a href=toggle.php?imageid=$imageid".
"&type=imageglobal&value=$globalflip>Toggle</a>)";
echo "$globalval (<a href='toggle.php?imageid=$imageid".
"&type=imageglobal&value=$globalflip'>Toggle</a>)";
echo " </td>
</tr>\n";
......@@ -762,8 +762,8 @@ class Image
echo "<tr>
<td>XEN Capable?:</td>
<td class=left>
$xenval (<a href=toggle.php?imageid=$imageid".
"&type=imagedoesxen&value=$xenflip>Toggle</a>
$xenval (<a href='toggle.php?imageid=$imageid".
"&type=imagedoesxen&value=$xenflip'>Toggle</a>
if you know this image can run
as a XEN guest. More info
<a target=_blank
......
<?php
#
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
# Copyright (c) 2005-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -52,7 +52,8 @@ if ($printable) {
<body>\n";
}
else {
echo "<b><a href=$REQUEST_URI?printable=1>
$REQUEST_URI = $_SERVER["REQUEST_URI"];
echo "<b><a href='$REQUEST_URI?printable=1'>
Printable version of this document</a></b><br>\n";
}
......
<?php
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -323,7 +323,7 @@ function doaction(theform) {
Iframe.contentWindow.document.close();
// And this fires it up.
Iframe.contentWindow.document.location =
'<?php echo $REQUEST_URI; ?>&start=1&level=' + level;
'<?php echo $_SERVER["REQUEST_URI"]; ?>&start=1&level=' + level;
curstate = "running";
theform['action'].value = "Stop Linktest";
......
......@@ -50,7 +50,7 @@ $BASEPATH = "";
# is no login active, we want to spit back http for the documentation,
# but https for the start/join pages.
#
if (isset($SSL_PROTOCOL)) {
if (isset($_SERVER["SSL_PROTOCOL"])) {
$BASEPATH = $TBBASE;
}
else {
......@@ -291,7 +291,7 @@ function WRITEPLABBOTTOMBAR() {
<center>
<br>
<font size=-1>
<form method=get action=$TBDOCBASE/search.php3>
<form method='get' action='$TBDOCBASE/search.php3'>
[ <a href='$WIKIDOCURL'>
Documentation</a> : <input name=query size = 15/>
<input type=submit style='font-size:10px;' value='Search' /> ]
......@@ -1039,7 +1039,7 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
$notice = NULL) {
global $login_status, $login_user;
global $TBBASE, $TBDOCBASE, $THISHOMEBASE;
global $BASEPATH, $SSL_PROTOCOL, $drewheader, $autorefresh;
global $BASEPATH, $drewheader, $autorefresh;
global $TBMAINSITE;
$drewheader = 1;
......@@ -1202,7 +1202,7 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
#
function PAGEFOOTER($view = NULL) {
global $TBDOCBASE, $TBMAILADDR, $THISHOMEBASE, $BASEPATH, $TBBASE;
global $TBMAINSITE, $SSL_PROTOCOL, $bodyclosestring, $currently_busy;
global $TBMAINSITE, $bodyclosestring, $currently_busy;
global $login_user, $javascript_debug, $sortedtables;
if ($currently_busy) {
......
<?php
#
# Copyright (c) 2004, 2005, 2006, 2007 University of Utah and the Flux Group.
# Copyright (c) 2004-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -86,7 +86,7 @@ else {
echo "<tr><th>$vname</th>";
echo "<td>$pnode</td><td>";
SHOWBLINKENLICHTEN($uid,
$HTTP_COOKIE_VARS[$TBAUTHCOOKIE],
$_COOKIE[$TBAUTHCOOKIE],
CreateURL("ledpipe", $pnode));
}
echo "</table>\n";
......
<?php
#
# Copyright (c) 2006-2010 University of Utah and the Flux Group.
# Copyright (c) 2006-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -727,8 +727,8 @@ class Project
$flip = ($cvsrepo_public ? 0 : 1);
echo "<tr>
<td>CVS Repository Publically Readable?:</td>
<td><a href=toggle.php?pid=$pid&type=cvsrepo_public".
"&value=$flip>$YesNo</a> (Click to toggle)</td>
<td><a href='toggle.php?pid=$pid&type=cvsrepo_public".
"&value=$flip'>$YesNo</a> (Click to toggle)</td>
</tr>\n";
if ($cvsrepo_public) {
......@@ -861,8 +861,8 @@ class Project
echo "<tr>
<td>Allow Workbench:</td>
<td><a href=toggle.php?pid=$pid&type=workbench".
"&value=$flip>$YesNo</a> (Click to toggle)</td>
<td><a href='toggle.php?pid=$pid&type=workbench".
"&value=$flip'>$YesNo</a> (Click to toggle)</td>
</tr>\n";
}
......
<?php
#
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -200,7 +200,7 @@ if ($retval) {
die("");
}
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$auth = $_COOKIE[$TBAUTHCOOKIE];
$pipeurl = "robopipe.php3?building=$building&floor=$floor";
$baseurl = "../floormap_aux.php3?prefix=$uniqueid";
......
<?php
#
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -116,7 +116,7 @@ echo "<table cellspacing=5 cellpadding=5 border=0 class=\"stealth\">
</tr>
</table><hr>\n";
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$auth = $_COOKIE[$TBAUTHCOOKIE];
$floorcount = mysql_num_rows($query_result);
$ppm = 1;
$index = 0;
......
<?php
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -184,7 +184,7 @@ if (! $isadmin) {
#
# Dump some Emulab auth vars for the xmlhttprequests
#
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$auth = $_COOKIE[$TBAUTHCOOKIE];
echo "<script language=javascript type=text/javascript>\n";
echo "var tbuid = \"$uid\";\n";
echo "var tbauth = \"$auth\";\n";
......
......@@ -30,7 +30,6 @@ include_once("osinfo_defs.php");
include_once("node_defs.php");
function SHOWNODES($pid, $eid, $sortby, $showclass) {
global $SCRIPT_NAME;
global $TBOPSPID;
global $WIKIDOCURL;
global $login_user;
......@@ -210,6 +209,7 @@ function SHOWNODES($pid, $eid, $sortby, $showclass) {
}
if ($pid == $TBOPSPID) {
$SCRIPT_NAME = $_SERVER["SCRIPT_NAME"];
echo "<th class='sorttable_nosort'>Reserved<br>
<a href=\"$SCRIPT_NAME?pid=$pid&eid=$eid".
"&sortby=rsrvtime-up&showclass=$showclass\">Up</a> or
......@@ -470,7 +470,7 @@ function SHOWWIDEAREAACCOUNTS($webid) {
#
# Example:
# SHOWBLINKENLICHTEN($uid,
# $HTTP_COOKIE_VARS[$TBAUTHCOOKIE],
# $_COOKIE[$TBAUTHCOOKIE],
# "ledpipe.php3?node=em1");
#
function SHOWBLINKENLICHTEN($uid, $auth, $pipeurl, $width = 40, $height = 10) {
......
<?php
#
# Copyright (c) 2003-2011 University of Utah and the Flux Group.
# Copyright (c) 2003-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -44,7 +44,7 @@ function handle_error($message, $death)
#
# Must be SSL, even though we do not require an account login.
#
if (!isset($SSL_PROTOCOL)) {
if (!isset($_SERVER["SSL_PROTOCOL"])) {
SPITERROR(400, "Must use https:// to access this page!");
}
......
<?php
#
# Copyright (c) 2003-2012 University of Utah and the Flux Group.
# Copyright (c) 2003-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -44,7 +44,7 @@ function handle_error($message, $death)
#
# Must be SSL, even though we do not require an account login.
#
if (!isset($SSL_PROTOCOL)) {
if (!isset($_SERVER["SSL_PROTOCOL"])) {
SPITERROR(400, "Must use https:// to access this page!");
}
......
......@@ -184,7 +184,7 @@ function GETUID() {
# Returns a combination of the CHECKLOGIN values above.
#
function LoginStatus() {
global $TBAUTHCOOKIE, $TBLOGINCOOKIE, $HTTP_COOKIE_VARS, $TBAUTHTIMEOUT;
global $TBAUTHCOOKIE, $TBLOGINCOOKIE, $TBAUTHTIMEOUT;
global $CHECKLOGIN_STATUS, $CHECKLOGIN_UID, $CHECKLOGIN_NODETYPES;
global $CHECKLOGIN_WIKINAME, $TBOPSPID;
global $EXPOSEARCHIVE, $EXPOSETEMPLATES;
......@@ -210,11 +210,11 @@ function LoginStatus() {
if (isset($_GET['nocookieauth'])) {
$curhash = $_GET['nocookieauth'];
}
elseif (array_key_exists($TBAUTHCOOKIE, $HTTP_COOKIE_VARS)) {
$curhash = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
elseif (array_key_exists($TBAUTHCOOKIE, $_COOKIE)) {
$curhash = $_COOKIE[$TBAUTHCOOKIE];
}
if (array_key_exists($TBLOGINCOOKIE, $HTTP_COOKIE_VARS)) {
$hashhash = $HTTP_COOKIE_VARS[$TBLOGINCOOKIE];
if (array_key_exists($TBLOGINCOOKIE, $_COOKIE)) {
$hashhash = $_COOKIE[$TBLOGINCOOKIE];
}
#
......@@ -1123,7 +1123,7 @@ function VERIFYPASSWD($uid, $password) {
function DOLOGOUT($user) {
global $CHECKLOGIN_STATUS, $CHECKLOGIN_USER;
global $TBAUTHCOOKIE, $TBLOGINCOOKIE, $TBAUTHDOMAIN, $WWWHOST;
global $WIKISUPPORT, $WIKICOOKIENAME, $HTTP_COOKIE_VARS;
global $WIKISUPPORT, $WIKICOOKIENAME;
global $BUGDBSUPPORT, $BUGDBCOOKIENAME, $TRACSUPPORT, $TRACCOOKIENAME;
global $TBLIBEXEC_DIR, $EXP_VIS;
......@@ -1146,11 +1146,11 @@ function DOLOGOUT($user) {
$curhash = "";
$hashhash = "";
if (isset($HTTP_COOKIE_VARS[$TBAUTHCOOKIE])) {
$curhash = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
if (isset($_COOKIE[$TBAUTHCOOKIE])) {
$curhash = $_COOKIE[$TBAUTHCOOKIE];
}
if (isset($HTTP_COOKIE_VARS[$TBLOGINCOOKIE])) {
$hashhash = $HTTP_COOKIE_VARS[$TBLOGINCOOKIE];
if (isset($_COOKIE[$TBLOGINCOOKIE])) {
$hashhash = $_COOKIE[$TBLOGINCOOKIE];
}
#
......
<?php
#
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
# Copyright (c) 2005-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -65,7 +65,7 @@ if ($status == "up") {
<param name='class' value='GarciaTelemetry'>
<param name='pipeurl' value='servicepipe.php3?node_id=$node_id'>
<param name='uid' value='$uid'>
<param name='auth' value='$HTTP_COOKIE_VARS[$TBAUTHCOOKIE]'>
<param name='auth' value='$_COOKIE[$TBAUTHCOOKIE]'>
</applet>\n";
}
else {
......
<?php
#
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
# Copyright (c) 2005-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -109,7 +109,7 @@ else {
}
if (isset($applet)) {
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$auth = $_COOKIE[$TBAUTHCOOKIE];
while ($row = mysql_fetch_array($query_result)) {
$id = $row["id"];
......
<?php
#
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -148,7 +148,7 @@ for ($i = 0; $i <= $count; ++$i) {
}
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$auth = $_COOKIE[$TBAUTHCOOKIE];
## the requester will need to append '&dataset=...'
$mapurl = "getdata.php3?type=map";
......
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