From 752083f4d811a92878796adcc7ca33ab94a8658b Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 19 Jan 2013 11:25:15 -0500 Subject: [PATCH 1/2] bug #3776 [cookies] Login without auth on second server --- ChangeLog | 1 + libraries/Config.class.php | 2 +- libraries/auth/cookie.auth.lib.php | 14 ++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 551bd4450d..4d34ef54bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog - bug #3598736 [routines] Editing a procedure with special characters - bug #3600322 [core] Visualize GIS data throws Fatal Error - bug #3599362 [core] Double-escaped error message +- bug #3776 [cookies] Login without auth on second server 3.5.5.0 (2012-12-21) - bug #3563824 [export] Support Apache's mod_deflate diff --git a/libraries/Config.class.php b/libraries/Config.class.php index d8cb909047..5ba4343058 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -1374,7 +1374,7 @@ class PMA_Config */ function setCookie($cookie, $value, $default = null, $validity = null, $httponly = true) { - if ($validity == null) { + if ($validity === null) { $validity = 2592000; } if (strlen($value) && null !== $default && $value === $default) { diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 4012db844d..13930b141c 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -493,11 +493,17 @@ function PMA_auth_set_user() PMA_get_blowfish_secret())); // Duration = as configured - $GLOBALS['PMA_Config']->setCookie('pmaPass-' . $GLOBALS['server'], - PMA_blowfish_encrypt(!empty($cfg['Server']['password']) ? $cfg['Server']['password'] : "\xff(blank)", - PMA_get_blowfish_secret()), + $GLOBALS['PMA_Config']->setCookie( + 'pmaPass-' . $GLOBALS['server'], + PMA_blowfish_encrypt( + ! empty($cfg['Server']['password']) + ? $cfg['Server']['password'] + : "\xff(blank)", + PMA_get_blowfish_secret() + ), null, - $GLOBALS['cfg']['LoginCookieStore']); + $GLOBALS['cfg']['LoginCookieStore'] + ); // Set server cookies if required (once per session) and, in this case, force // reload to ensure the client accepts cookies From ebb89e8521e437d017ec6211677d639dc035b693 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 19 Jan 2013 11:29:45 -0500 Subject: [PATCH 2/2] Fix merge conflicts --- ChangeLog | 1 + libraries/Config.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e8aaadfcd0..0e76d8c185 100644 --- a/ChangeLog +++ b/ChangeLog @@ -93,6 +93,7 @@ VerboseMultiSubmit, ReplaceHelpImg - bug #3598736 [routines] Editing a procedure with special characters - bug #3600322 [core] Visualize GIS data throws Fatal Error - bug #3599362 [core] Double-escaped error message +- bug #3776 [cookies] Login without auth on second server 3.5.5.0 (2012-12-21) - bug #3563824 [export] Support Apache's mod_deflate diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 33fc5a5d0e..34c02c9262 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -1755,7 +1755,7 @@ class PMA_Config if (! isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) { // set cookie with new value /* Calculate cookie validity */ - if ($validity == null) { + if ($validity === null) { $validity = time() + 2592000; } elseif ($validity == 0) { $validity = 0;