adminerevo/plugins/login-sqlite.php

30 lines
773 B
PHP
Raw Normal View History

2016-11-28 18:09:51 +00:00
<?php
/** Enable login for SQLite
2016-11-28 18:09:51 +00:00
* @link https://www.adminer.org/plugins/#use
2017-02-27 12:43:33 +00:00
* @author Jakub Vrana, https://www.vrana.cz/
2018-01-14 10:03:54 +00:00
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
2016-11-28 18:09:51 +00:00
*/
class AdminerLoginSqlite {
var $login;
var $password_hash;
/**
* @param string
* @param string result of password_hash
*/
function AdminerLoginSqlite($login, $password_hash) {
$this->login = $login;
$this->password_hash = $password_hash;
2016-11-28 18:09:51 +00:00
}
function login($login, $password) {
if (DRIVER != "sqlite" && DRIVER != "sqlite2") {
return true;
}
return $this->login == $login && password_verify($password, $this->password_hash);
2016-11-28 18:09:51 +00:00
}
}