diff --git a/abstraction.inc.php b/abstraction.inc.php index 400d6934..aa56905e 100644 --- a/abstraction.inc.php +++ b/abstraction.inc.php @@ -5,9 +5,10 @@ if (extension_loaded("mysqli")) { $this->init(); } - function connect($server, $username, $password, $port) { + function connect($server, $username, $password) { + list($host, $port) = explode(":", $server, 2); return @$this->real_connect( - (strlen($server) ? $server : ini_get("mysqli.default_host")), + (strlen($server) ? $host : ini_get("mysqli.default_host")), (strlen("$server$username") ? $username : ini_get("mysqli.default_user")), (strlen("$server$username$password") ? $password : ini_get("mysqli.default_pw")), null, @@ -27,9 +28,9 @@ if (extension_loaded("mysqli")) { class Min_MySQL { var $_link, $_result, $server_info, $affected_rows, $error; - function connect($server, $username, $password, $port) { + function connect($server, $username, $password) { $this->_link = @mysql_connect( - (strlen($server) ? $server : ini_get("mysql.default_host")) . (strlen($port) ? ":$port" : ""), + (strlen($server) ? $server : ini_get("mysql.default_host")), (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 @@ -115,9 +116,9 @@ if (extension_loaded("mysqli")) { function __construct() { } - function connect($server, $username, $password, $port) { + function connect($server, $username, $password) { set_exception_handler('auth_error'); // try/catch is not compatible with PHP 4 - parent::__construct("mysql:host=$server" . (strlen($port) ? ";port=$port" : ""), $username, $password); + parent::__construct("mysql:host=" . str_replace(":", ";port=", $server), $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 e1cef529..d3f8e556 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -8,7 +8,6 @@ if (isset($_POST["server"])) { session_regenerate_id(); $_SESSION["usernames"][$_POST["server"]] = $_POST["username"]; $_SESSION["passwords"][$_POST["server"]] = $_POST["password"]; - $_SESSION["ports"][$_POST["server"]] = $_POST["port"]; if (count($_POST) == count($ignore)) { if ((string) $_GET["server"] === $_POST["server"]) { $location = remove_from_uri(); @@ -26,7 +25,6 @@ if (isset($_POST["server"])) { } elseif (isset($_GET["logout"])) { unset($_SESSION["usernames"][$_GET["server"]]); unset($_SESSION["passwords"][$_GET["server"]]); - unset($_SESSION["ports"][$_GET["server"]]); unset($_SESSION["databases"][$_GET["server"]]); $_SESSION["tokens"][$_GET["server"]] = array(); redirect(substr($SELF, 0, -1), lang('Logout successful.')); @@ -53,7 +51,6 @@ function auth_error() { :" /> : : - :" />

connect($_GET["server"], $username, $_SESSION["passwords"][$_GET["server"]], $_SESSION["ports"][$_GET["server"]])) { +if (!isset($username) || !$mysql->connect($_GET["server"], $username, $_SESSION["passwords"][$_GET["server"]])) { auth_error(); exit; } diff --git a/lang/cs.inc.php b/lang/cs.inc.php index 844fe1d7..b7e87a66 100644 --- a/lang/cs.inc.php +++ b/lang/cs.inc.php @@ -162,5 +162,4 @@ $translations = array( 'Routine' => 'Procedura', 'Grant' => 'Povolit', 'Revoke' => 'Zakázat', - 'Port' => 'Port', ); diff --git a/lang/nl.inc.php b/lang/nl.inc.php index c8875fbd..6f2e55b4 100644 --- a/lang/nl.inc.php +++ b/lang/nl.inc.php @@ -162,5 +162,4 @@ $translations = array( 'Routine' => 'Routine', 'Grant' => 'Toekennen', 'Revoke' => 'Intrekken', - 'Port' => 'Poort', ); diff --git a/lang/sk.inc.php b/lang/sk.inc.php index 2a364428..4ab2e8e0 100644 --- a/lang/sk.inc.php +++ b/lang/sk.inc.php @@ -162,5 +162,4 @@ $translations = array( 'Routine' => 'Procedúra', 'Grant' => 'Povoliť', 'Revoke' => 'Zakázať', - 'Port' => 'Port', );