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;