From 177ea6c5d57c4ae99b50c7bc6b8ba762fb2b27fd Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 16 Oct 2007 12:52:36 +0000 Subject: [PATCH] do not connect twice if no controluser is defined, no controluser query should affect user connection (no DB change) --- libraries/common.inc.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 731249ae6..d55e33d43 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -832,8 +832,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { unset($allowDeny_forbidden); //Clean up after you! } - $bkp_track_err = @ini_set('track_errors', 1); - // Try to connect MySQL with the control user profile (will be used to // get the privileges list for the current user but the true user link // must be open after this one so it would be default one for all the @@ -843,20 +841,14 @@ if (! defined('PMA_MINIMUM_COMMON')) { $controllink = PMA_DBI_connect($cfg['Server']['controluser'], $cfg['Server']['controlpass'], true); } - if (! $controllink) { - $controllink = PMA_DBI_connect($cfg['Server']['user'], - $cfg['Server']['password'], true); - } // end if ... else - - // Pass #1 of DB-Config to read in master level DB-Config will go here - // Robbat2 - May 11, 2002 // Connects to the server (validates user's login) $userlink = PMA_DBI_connect($cfg['Server']['user'], $cfg['Server']['password'], false); - // Pass #2 of DB-Config to read in user level DB-Config will go here - // Robbat2 - May 11, 2002 + if (! $controllink) { + $controllink = $userlink; + } /** * with phpMyAdmin 3 we support MySQL >=5 @@ -867,9 +859,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { PMA_fatalError('strUpgrade', array('MySQL', '5.0.15')); } - @ini_set('track_errors', $bkp_track_err); - unset($bkp_track_err); - /** * SQL Parser code */