From 6b128566f31a86e4f98bc2e48eab825dee8ab4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 18 Jan 2007 11:11:15 +0000 Subject: [PATCH] Make server switching honour more server settings (patch #1630104). --- ChangeLog | 2 ++ libraries/auth/cookie.auth.lib.php | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c32f7927d..4184cce1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $HeadURL$ 2007-01-18 Michal Čihař * lang/czech: Updated. + * libraries/auth/cookie.auth.lib.php: Make server switching honour more + server settings (patch #1630104). 2007-01-17 Marc Delisle * lang/turkish: update, thanks to Burak Yavuz - bourock diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 14c0e2679..881a8f945 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -413,15 +413,18 @@ function PMA_auth_set_user() // Ensures valid authentication mode, 'only_db', bookmark database and // table names and relation table name are used if ($cfg['Server']['user'] != $PHP_AUTH_USER) { - $servers_cnt = count($cfg['Servers']); - for ($i = 1; $i <= $servers_cnt; $i++) { - if (isset($cfg['Servers'][$i]) - && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) { - $server = $i; - $cfg['Server'] = $cfg['Servers'][$i]; + foreach ($cfg['Servers'] as $idx => $current) { + if ($current['host'] == $cfg['Server']['host'] + && $current['port'] == $cfg['Server']['port'] + && $current['socket'] == $cfg['Server']['socket'] + && $current['ssl'] == $cfg['Server']['ssl'] + && $current['connect_type'] == $cfg['Server']['connect_type'] + && $current['user'] == $PHP_AUTH_USER) { + $server = $idx; + $cfg['Server'] = $current; break; } - } // end for + } // end foreach } // end if $pma_server_changed = false;