From 651b357f8a2d756e4e3f978c9b78750bcc44d0f5 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 15 Feb 2011 17:33:48 +0100 Subject: [PATCH] Whitespace cleanup --- libraries/dbi/mysql.dbi.lib.php | 16 +++++----- libraries/dbi/mysqli.dbi.lib.php | 52 ++++++++++++++++---------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 2ddd765e0..c4f22fb28 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -63,12 +63,12 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu ? false : true; } else { - $server_port = (empty($cfg['Server']['port'])) - ? '' - : ':' . (int)$cfg['Server']['port']; - $server_socket = (empty($cfg['Server']['socket'])) - ? '' - : ':' . $cfg['Server']['socket']; + $server_port = (empty($cfg['Server']['port'])) + ? '' + : ':' . (int)$cfg['Server']['port']; + $server_socket = (empty($cfg['Server']['socket'])) + ? '' + : ':' . $cfg['Server']['socket']; } if (strtolower($cfg['Server']['connect_type']) == 'tcp') { @@ -97,11 +97,11 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu // Retry with empty password if we're allowed to if (empty($link) && $cfg['Server']['nopassword'] && !$is_controluser) { - $link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? NULL : $client_flags); + $link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? NULL : $client_flags); } } else { if (!isset($server['host'])) { - $link = PMA_DBI_real_connect($server_socket, $user, $password, NULL, $server_persistant); + $link = PMA_DBI_real_connect($server_socket, $user, $password, NULL, $server_persistant); } else { $link = PMA_DBI_real_connect($server['host'] . $server_port . $server_socket, $user, $password, NULL, $server_persistant); } diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 71693ab35..a6eff91a0 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -66,22 +66,22 @@ if (! defined('MYSQLI_TYPE_BIT')) { function PMA_DBI_connect($user, $password, $is_controluser = false, $server = null, $auxiliary_connection = false) { if ($server) { - $server_port = (empty($server['port'])) - ? false - : (int)$server['port']; - $server_socket = (empty($server['socket'])) - ? '' - : $server['socket']; - $server['host'] = (empty($server['host'])) - ? 'localhost' - : $server['host']; + $server_port = (empty($server['port'])) + ? false + : (int)$server['port']; + $server_socket = (empty($server['socket'])) + ? '' + : $server['socket']; + $server['host'] = (empty($server['host'])) + ? 'localhost' + : $server['host']; } else { - $server_port = (empty($GLOBALS['cfg']['Server']['port'])) - ? false - : (int) $GLOBALS['cfg']['Server']['port']; - $server_socket = (empty($GLOBALS['cfg']['Server']['socket'])) - ? null - : $GLOBALS['cfg']['Server']['socket']; + $server_port = (empty($GLOBALS['cfg']['Server']['port'])) + ? false + : (int) $GLOBALS['cfg']['Server']['port']; + $server_socket = (empty($GLOBALS['cfg']['Server']['socket'])) + ? null + : $GLOBALS['cfg']['Server']['socket']; } @@ -108,25 +108,25 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu } if (!$server) { - $return_value = @mysqli_real_connect($link, $GLOBALS['cfg']['Server']['host'], $user, $password, false, $server_port, $server_socket, $client_flags); - // Retry with empty password if we're allowed to - if ($return_value == false && isset($GLOBALS['cfg']['Server']['nopassword']) && $GLOBALS['cfg']['Server']['nopassword'] && !$is_controluser) { - $return_value = @mysqli_real_connect($link, $GLOBALS['cfg']['Server']['host'], $user, '', false, $server_port, $server_socket, $client_flags); - } + $return_value = @mysqli_real_connect($link, $GLOBALS['cfg']['Server']['host'], $user, $password, false, $server_port, $server_socket, $client_flags); + // Retry with empty password if we're allowed to + if ($return_value == false && isset($GLOBALS['cfg']['Server']['nopassword']) && $GLOBALS['cfg']['Server']['nopassword'] && !$is_controluser) { + $return_value = @mysqli_real_connect($link, $GLOBALS['cfg']['Server']['host'], $user, '', false, $server_port, $server_socket, $client_flags); + } } else { - $return_value = @mysqli_real_connect($link, $server['host'], $user, $password, false, $server_port, $server_socket); + $return_value = @mysqli_real_connect($link, $server['host'], $user, $password, false, $server_port, $server_socket); } if ($return_value == false) { - if ($is_controluser) { - trigger_error(__('Connection for controluser as defined in your configuration failed.'), E_USER_WARNING); - return false; - } + if ($is_controluser) { + trigger_error(__('Connection for controluser as defined in your configuration failed.'), E_USER_WARNING); + return false; + } // we could be calling PMA_DBI_connect() to connect to another // server, for example in the Synchronize feature, so do not // go back to main login if it fails if (! $auxiliary_connection) { - PMA_log_user($user, 'mysql-denied'); + PMA_log_user($user, 'mysql-denied'); PMA_auth_fails(); } else { return false;