From b3d5c9affe72a0e4ebdce68d3eb5ef80016b1769 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 16 Jan 2018 16:37:59 +0100 Subject: [PATCH] Require specifying credentials in login-sqlite plugin --- adminer/sqlite.php | 2 +- plugins/login-sqlite.php | 41 +++++++++++++++++----------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/adminer/sqlite.php b/adminer/sqlite.php index b7463361..5f6f219c 100644 --- a/adminer/sqlite.php +++ b/adminer/sqlite.php @@ -2,7 +2,7 @@ function adminer_object() { include_once "../plugins/plugin.php"; include_once "../plugins/login-sqlite.php"; - return new AdminerPlugin(array(new AdminerLoginSqlite)); + return new AdminerPlugin(array(new AdminerLoginSqlite("admin", password_hash("", PASSWORD_DEFAULT)))); } include "./index.php"; diff --git a/plugins/login-sqlite.php b/plugins/login-sqlite.php index 245605dd..d3adae5c 100644 --- a/plugins/login-sqlite.php +++ b/plugins/login-sqlite.php @@ -1,36 +1,29 @@ login = $login; + $this->password_hash = $password_hash; + } + function login($login, $password) { - return true; - } - - function loginForm() { - ?> -> -addEventListener('load', function () { - var driver = qs('name="auth[driver]"'); - if (isTag(driver, 'select')) { - driver.onchange = function () { - var trs = parentTag(driver, 'table').rows; - for (var i=1; i < trs.length - 1; i++) { - var disabled = /sqlite/.test(driver.value); - alterClass(trs[i], 'hidden', disabled); - trs[i].querySelector('input').disabled = disabled; - } - }; - } - driver.onchange(); -}); - -login == $login && password_verify($password, $this->password_hash); } }