use PMA_getenv()

This commit is contained in:
Sebastian Mendel
2006-04-11 14:33:17 +00:00
parent f813549799
commit 44a0f36096
13 changed files with 1173 additions and 732 deletions

View File

@@ -79,38 +79,34 @@ function PMA_auth_check()
// '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 (isset($_SERVER['PHP_AUTH_USER'])) {
$PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER'];
} elseif (getenv('PHP_AUTH_USER')) {
$PHP_AUTH_USER = getenv('PHP_AUTH_USER');
} elseif (getenv('REMOTE_USER')) {
if (PMA_getenv('PHP_AUTH_USER')) {
$PHP_AUTH_USER = PMA_getenv('PHP_AUTH_USER');
} elseif (PMA_getenv('REMOTE_USER')) {
// CGI, might be encoded, see bellow
$PHP_AUTH_USER = getenv('REMOTE_USER');
} elseif (getenv('AUTH_USER')) {
$PHP_AUTH_USER = PMA_getenv('REMOTE_USER');
} elseif (PMA_getenv('AUTH_USER')) {
// WebSite Professional
$PHP_AUTH_USER = getenv('AUTH_USER');
} elseif (getenv('HTTP_AUTHORIZATION')) {
$PHP_AUTH_USER = PMA_getenv('AUTH_USER');
} elseif (PMA_getenv('HTTP_AUTHORIZATION')) {
// IIS, might be encoded, see bellow
$PHP_AUTH_USER = getenv('HTTP_AUTHORIZATION');
} elseif (getenv('Authorization')) {
$PHP_AUTH_USER = PMA_getenv('HTTP_AUTHORIZATION');
} elseif (PMA_getenv('Authorization')) {
// FastCGI, might be encoded, see bellow
$PHP_AUTH_USER = getenv('Authorization');
$PHP_AUTH_USER = PMA_getenv('Authorization');
}
}
// 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 (isset($_SERVER['PHP_AUTH_PW'])) {
$PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];
} elseif (getenv('PHP_AUTH_PW')) {
$PHP_AUTH_PW = getenv('PHP_AUTH_PW');
} elseif (getenv('REMOTE_PASSWORD')) {
if (PMA_getenv('PHP_AUTH_PW')) {
$PHP_AUTH_PW = PMA_getenv('PHP_AUTH_PW');
} elseif (PMA_getenv('REMOTE_PASSWORD')) {
// Apache/CGI
$PHP_AUTH_PW = getenv('REMOTE_PASSWORD');
} elseif (getenv('AUTH_PASSWORD')) {
$PHP_AUTH_PW = PMA_getenv('REMOTE_PASSWORD');
} elseif (PMA_getenv('AUTH_PASSWORD')) {
// WebSite Professional
$PHP_AUTH_PW = getenv('AUTH_PASSWORD');
$PHP_AUTH_PW = PMA_getenv('AUTH_PASSWORD');
}
}