Improved a bit the detection mechanism

This commit is contained in:
Loïc Chapeaux
2002-05-26 13:09:35 +00:00
parent 1df9bd61b8
commit 405ff52b51
2 changed files with 9 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ $Source$
- fixed a warning thanks to
Svetlio Kovachev <svetlio at users.sourceforge.net>;
- coding standards.
* libraries/auth/cookies.auth.php3: improved a bit the detection mechanism.
2002-05-25 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3:

View File

@@ -92,6 +92,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
<head>
<title>phpMyAdmin <?php echo PMA_VERSION; ?></title>
<base href="<?php echo $cfg['PmaAbsoluteUri']; ?>" />
<style type="text/css">
<!--
body {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
@@ -298,24 +299,27 @@ if (uname.value == '') {
else {
if (!empty($pma_cookie_username)) {
$PHP_AUTH_USER = $pma_cookie_username;
$from_cookie = TRUE;
}
else if (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_username'])) {
$PHP_AUTH_USER = $_COOKIE['pma_cookie_username'];
$from_cookie = TRUE;
}
else if (!empty($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS['pma_cookie_username'])) {
$PHP_AUTH_USER = $HTTP_COOKIE_VARS['pma_cookie_username'];
$from_cookie = TRUE;
}
if (!empty($pma_cookie_password)) {
$PHP_AUTH_PW = $pma_cookie_password;
$from_cookie = TRUE;
}
else if (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_password'])) {
$PHP_AUTH_PW = $_COOKIE['pma_cookie_password'];
$from_cookie = TRUE;
}
else if (!empty($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS['pma_cookie_password'])) {
$PHP_AUTH_PW = $HTTP_COOKIE_VARS['pma_cookie_password'];
$from_cookie = TRUE;
}
else {
$from_cookie = FALSE;
}
}
@@ -377,7 +381,7 @@ if (uname.value == '') {
setcookie('pma_cookie_username',
$cfg['Server']['user'],
time() + (60 * 60 * 24 * 30),
$GLOBALS['cookie_path'], '' ,
$GLOBALS['cookie_path'], '',
$GLOBALS['is_https']);
// Duration = till the browser is closed for password
setcookie('pma_cookie_password',