mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 12:21:24 +02:00
Improve SQLite login error message
This commit is contained in:
@@ -110,7 +110,7 @@ focus(document.getElementById('username'));
|
||||
function login($login, $password) {
|
||||
global $jush;
|
||||
if ($jush == "sqlite") {
|
||||
return lang('Implement %s method to use SQLite.', 'login()');
|
||||
return lang('<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.', '<code>login()</code>');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -120,7 +120,6 @@ function unset_permanent() {
|
||||
*/
|
||||
function auth_error($error) {
|
||||
global $adminer, $has_token;
|
||||
$error = h($error);
|
||||
$session_name = session_name();
|
||||
if (isset($_GET["username"])) {
|
||||
header("HTTP/1.1 403 Forbidden"); // 401 requires sending WWW-Authenticate header
|
||||
@@ -168,7 +167,7 @@ if (isset($_GET["username"])) {
|
||||
$driver = new Min_Driver($connection);
|
||||
|
||||
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
|
||||
auth_error((is_string($connection) ? $connection : (is_string($login) ? $login : lang('Invalid credentials.'))));
|
||||
auth_error((is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.'))));
|
||||
}
|
||||
|
||||
if ($auth && $_POST["token"]) {
|
||||
|
@@ -16,7 +16,7 @@ if (extension_loaded('pdo')) {
|
||||
try {
|
||||
parent::__construct($dsn, $username, $password);
|
||||
} catch (Exception $ex) {
|
||||
auth_error($ex->getMessage());
|
||||
auth_error(h($ex->getMessage()));
|
||||
}
|
||||
$this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
|
||||
$this->server_info = @$this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
|
||||
|
Reference in New Issue
Block a user