Merged the socket patch from Dan Allen

This commit is contained in:
Loïc Chapeaux
2001-08-20 20:08:01 +00:00
parent c3d62b3988
commit 662df47fa8
4 changed files with 28 additions and 10 deletions

View File

@@ -263,11 +263,18 @@ if (!defined('__LIB_INC__')){
if ($do_auth) {
auth();
} else {
if (empty($cfgServer['port'])) {
$dbh = @$connect_func($cfgServer['host'], $cfgServer['stduser'], $cfgServer['stdpass']) or mysql_die();
} else {
$dbh = @$connect_func($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['stduser'], $cfgServer['stdpass']) or mysql_die();
}
$server_port = (empty($cfgServer['port']))
? ''
: ':' . $cfgServer['port'];
$server_socket = (empty($cfgServer['socket']) || PMA_INT_VERSION < 30010)
? ''
: ':' . $cfgServer['socket'];
$dbh = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket,
$cfgServer['stduser'],
$cfgServer['stdpass']
) or mysql_die();
$PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER);
$PHP_AUTH_PW = str_replace('\'', '\\\'', $PHP_AUTH_PW);
$auth_query = 'SELECT User, Password, Select_priv '