From a6e54b58ed804b8127024ef3abceaee29d6f9a37 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sun, 30 Sep 2007 10:19:06 +0000 Subject: [PATCH] Connection port git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@357 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- abstraction.inc.php | 14 ++++++++------ auth.inc.php | 7 +++++-- design.inc.php | 2 +- lang/cs.inc.php | 1 + lang/nl.inc.php | 1 + lang/sk.inc.php | 1 + 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/abstraction.inc.php b/abstraction.inc.php index 96bf2b2d..400d6934 100644 --- a/abstraction.inc.php +++ b/abstraction.inc.php @@ -5,11 +5,13 @@ if (extension_loaded("mysqli")) { $this->init(); } - function connect($server, $username, $password) { + function connect($server, $username, $password, $port) { return @$this->real_connect( (strlen($server) ? $server : ini_get("mysqli.default_host")), (strlen("$server$username") ? $username : ini_get("mysqli.default_user")), - (strlen("$server$username$password") ? $password : ini_get("mysqli.default_pw")) + (strlen("$server$username$password") ? $password : ini_get("mysqli.default_pw")), + null, + (strlen($port) ? $port : ini_get("mysqli.default_port")) ); } @@ -25,9 +27,9 @@ if (extension_loaded("mysqli")) { class Min_MySQL { var $_link, $_result, $server_info, $affected_rows, $error; - function connect($server, $username, $password) { + function connect($server, $username, $password, $port) { $this->_link = @mysql_connect( - (strlen($server) ? $server : ini_get("mysql.default_host")), + (strlen($server) ? $server : ini_get("mysql.default_host")) . (strlen($port) ? ":$port" : ""), (strlen("$server$username") ? $username : ini_get("mysql.default_user")), (strlen("$server$username$password") ? $password : ini_get("mysql.default_password")), 131072 // CLIENT_MULTI_RESULTS for CALL @@ -113,9 +115,9 @@ if (extension_loaded("mysqli")) { function __construct() { } - function connect($server, $username, $password) { + function connect($server, $username, $password, $port) { set_exception_handler('auth_error'); // try/catch is not compatible with PHP 4 - parent::__construct("mysql:host=$server", $username, $password); + parent::__construct("mysql:host=$server" . (strlen($port) ? ";port=$port" : ""), $username, $password); restore_exception_handler(); $this->setAttribute(13, array('Min_PDOStatement')); // PDO::ATTR_STATEMENT_CLASS $this->server_info = $this->result($this->query("SELECT VERSION()")); diff --git a/auth.inc.php b/auth.inc.php index d737568f..e1cef529 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -1,5 +1,5 @@ :" /> : : + :" />

connect($_GET["server"], $username, $_SESSION["passwords"][$_GET["server"]])) { +if (!isset($username) || !$mysql->connect($_GET["server"], $username, $_SESSION["passwords"][$_GET["server"]], $_SESSION["ports"][$_GET["server"]])) { auth_error(); exit; } diff --git a/design.inc.php b/design.inc.php index f12498c2..866cc392 100644 --- a/design.inc.php +++ b/design.inc.php @@ -9,7 +9,7 @@ function page_header($title, $breadcrumb = array(), $title2 = "") { -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.4.1-dev"; ?> +<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.5.0-dev"; ?> diff --git a/lang/cs.inc.php b/lang/cs.inc.php index b7e87a66..844fe1d7 100644 --- a/lang/cs.inc.php +++ b/lang/cs.inc.php @@ -162,4 +162,5 @@ $translations = array( 'Routine' => 'Procedura', 'Grant' => 'Povolit', 'Revoke' => 'Zakázat', + 'Port' => 'Port', ); diff --git a/lang/nl.inc.php b/lang/nl.inc.php index 6f2e55b4..c8875fbd 100644 --- a/lang/nl.inc.php +++ b/lang/nl.inc.php @@ -162,4 +162,5 @@ $translations = array( 'Routine' => 'Routine', 'Grant' => 'Toekennen', 'Revoke' => 'Intrekken', + 'Port' => 'Poort', ); diff --git a/lang/sk.inc.php b/lang/sk.inc.php index 4ab2e8e0..2a364428 100644 --- a/lang/sk.inc.php +++ b/lang/sk.inc.php @@ -162,4 +162,5 @@ $translations = array( 'Routine' => 'Procedúra', 'Grant' => 'Povoliť', 'Revoke' => 'Zakázať', + 'Port' => 'Port', );