Taken into account the new $_* globals arrays defined with php 4.1+

This commit is contained in:
Loïc Chapeaux
2001-11-25 12:20:49 +00:00
parent 72c3169b37
commit 0b1fea0ae4
6 changed files with 84 additions and 12 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-11-25 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* index.php3; libraries/common.lib.php3; libraries/defines.lib.php3;
libraries/grab_globals.lib.php3; libraries/select_lang.lib.php3:
taken into account the new $_* globals arrays defined with php 4.1+.
2001-11-24 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* main.php3, line 200: fixed bug #485116 - No logout option for users.
* Documentation.html, lines 969-979: added an other entry about the

View File

@@ -12,8 +12,12 @@ require('./libraries/common.lib.php3');
PMA_setFontSizes();
// Gets the host name
// loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
if (empty($HTTP_HOST)) {
if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_HOST'])) {
if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
$HTTP_HOST = $_ENV['HTTP_HOST'];
}
else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_HOST'])) {
$HTTP_HOST = $HTTP_ENV_VARS['HTTP_HOST'];
}
else if (@getenv('HTTP_HOST')) {

View File

@@ -357,13 +357,21 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
if ($cfgServer['adv_auth']) {
// Grabs the $PHP_AUTH_USER variable whatever are the values of the
// 'register_globals' and the 'variables_order' directives
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (empty($PHP_AUTH_USER)) {
if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['PHP_AUTH_USER'])) {
if (!empty($_SERVER) && isset($_SERVER['PHP_AUTH_USER'])) {
$PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER'];
}
else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['PHP_AUTH_USER'])) {
$PHP_AUTH_USER = $HTTP_SERVER_VARS['PHP_AUTH_USER'];
}
else if (isset($REMOTE_USER)) {
$PHP_AUTH_USER = $REMOTE_USER;
}
else if (!empty($_ENV) && isset($_ENV['REMOTE_USER'])) {
$PHP_AUTH_USER = $_ENV['REMOTE_USER'];
}
else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['REMOTE_USER'])) {
$PHP_AUTH_USER = $HTTP_ENV_VARS['REMOTE_USER'];
}
@@ -374,6 +382,9 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
else if (isset($AUTH_USER)) {
$PHP_AUTH_USER = $AUTH_USER;
}
else if (!empty($_ENV) && isset($_ENV['AUTH_USER'])) {
$PHP_AUTH_USER = $_ENV['AUTH_USER'];
}
else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['AUTH_USER'])) {
$PHP_AUTH_USER = $HTTP_ENV_VARS['AUTH_USER'];
}
@@ -383,13 +394,21 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
}
// Grabs the $PHP_AUTH_PW variable whatever are the values of the
// 'register_globals' and the 'variables_order' directives
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (empty($PHP_AUTH_PW)) {
if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
if (!empty($_SERVER) && isset($_SERVER['PHP_AUTH_PW'])) {
$PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];
}
else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
$PHP_AUTH_PW = $HTTP_SERVER_VARS['PHP_AUTH_PW'];
}
else if (isset($REMOTE_PASSWORD)) {
$PHP_AUTH_PW = $REMOTE_PASSWORD;
}
else if (!empty($_ENV) && isset($_ENV['REMOTE_PASSWORD'])) {
$PHP_AUTH_PW = $_ENV['REMOTE_PASSWORD'];
}
else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['REMOTE_PASSWORD'])) {
$PHP_AUTH_PW = $HTTP_ENV_VARS['REMOTE_PASSWORD'];
}
@@ -400,6 +419,9 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
else if (isset($AUTH_PASSWORD)) {
$PHP_AUTH_PW = $AUTH_PASSWORD;
}
else if (!empty($_ENV) && isset($_ENV['AUTH_PASSWORD'])) {
$PHP_AUTH_PW = $_ENV['AUTH_PASSWORD'];
}
else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['AUTH_PASSWORD'])) {
$PHP_AUTH_PW = $HTTP_ENV_VARS['AUTH_PASSWORD'];
}
@@ -409,8 +431,15 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
}
// Grabs the $old_usr variable whatever are the values of the
// 'register_globals' and the 'variables_order' directives
if (empty($old_usr) && !empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS['old_usr'])) {
$old_usr = $HTTP_GET_VARS['old_usr'];
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (empty($old_usr)) {
if (!empty($_GET) && isset($_GET['old_usr'])) {
$old_usr = $_GET['old_usr'];
}
else if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS['old_usr'])) {
$old_usr = $HTTP_GET_VARS['old_usr'];
}
}
// First load -> checks if authentication is required

View File

@@ -83,7 +83,11 @@ if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
// Based on a phpBuilder article:
// see http://www.phpbuilder.net/columns/tim20000821.php3
if (!defined('PMA_USR_OS')) {
if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
} else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
// 1. Platform

View File

@@ -6,19 +6,29 @@
* This library grabs the names and values of the variables sent or posted to a
* script in the '$HTTP_*_VARS' arrays and sets simple globals variables from
* them
*
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
define('PMA_GRAB_GLOBALS_INCLUDED', 1);
if (!empty($HTTP_GET_VARS)) {
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
} // end if
if (!empty($HTTP_POST_VARS)) {
if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
} // end if
if (!empty($HTTP_POST_FILES)) {
if (!empty($_FILES)) {
while (list($name, $value) = each($_FILES)) {
$$name = $value['tmp_name'];
}
} else if (!empty($HTTP_POST_FILES)) {
while (list($name, $value) = each($HTTP_POST_FILES)) {
$$name = $value['tmp_name'];
}

View File

@@ -111,18 +111,38 @@ if (!defined('PMA_IS_LANG_DETECT_FUNCTION')) {
/**
* Get some global variables if 'register_globals' is set to 'off'
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/
if (!empty($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']))
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']))
}
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
if (!isset($lang)) {
if (isset($HTTP_GET_VARS) && !empty($HTTP_GET_VARS['lang'])) {
if (isset($_GET) && !empty($_GET['lang'])) {
$lang = $_GET['lang'];
}
else if (isset($HTTP_GET_VARS) && !empty($HTTP_GET_VARS['lang'])) {
$lang = $HTTP_GET_VARS['lang'];
}
else if (isset($_POST) && !empty($_POST['lang'])) {
$lang = $_POST['lang'];
}
else if (isset($HTTP_POST_VARS) && !empty($HTTP_POST_VARS['lang'])) {
$lang = $HTTP_POST_VARS['lang'];
}
else if (isset($_COOKIE) && !empty($_COOKIE['lang'])) {
$lang = $_COOKIE['lang'];
}
else if (isset($HTTP_COOKIE_VARS) && !empty($HTTP_COOKIE_VARS['lang'])) {
$lang = $HTTP_COOKIE_VARS['lang'];
}