mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
MSSQL, MongoDB: Connect to localhost with default port if server is not specified
This commit is contained in:
@@ -629,6 +629,11 @@ if (isset($_GET["mongo"])) {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
list($server, $username, $password) = $adminer->credentials();
|
||||
|
||||
if ($server == "") {
|
||||
$server = "localhost:27017";
|
||||
}
|
||||
|
||||
$options = array();
|
||||
if ($username . $password != "") {
|
||||
$options["username"] = $username;
|
||||
|
@@ -303,6 +303,11 @@ if (isset($_GET["mssql"])) {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
|
||||
if ($credentials[0] == "") {
|
||||
$credentials[0] = "localhost:1433";
|
||||
}
|
||||
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
}
|
||||
|
Reference in New Issue
Block a user