1
0
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:
Peter Knut
2024-11-10 20:58:23 +01:00
committed by Jakub Vrana
parent 99434644ef
commit 0628b8de02
2 changed files with 10 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;
}