1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Disallow using password-less databases

This commit is contained in:
Jakub Vrana
2018-05-04 16:52:41 +02:00
parent db11fa4c1a
commit 60d1b7b3b4
15 changed files with 47 additions and 24 deletions

View File

@@ -227,8 +227,11 @@ if (isset($_GET["elastic"])) {
function connect() {
global $adminer;
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
list($server, $username, $password) = $adminer->credentials();
if ($password != "" && $connection->connect($server, $username, "")) {
return lang('Database does not support password.');
}
if ($connection->connect($server, $username, $password)) {
return $connection;
}
return $connection->error;