2016-11-28 10:09:51 -08:00
|
|
|
<?php
|
|
|
|
|
|
2025-04-07 16:32:57 +02:00
|
|
|
/** Enable login without password
|
2016-11-28 10:09:51 -08:00
|
|
|
* @link https://www.adminer.org/plugins/#use
|
2017-02-27 13:43:33 +01:00
|
|
|
* @author Jakub Vrana, https://www.vrana.cz/
|
2018-01-14 11:03:54 +01: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 10:09:51 -08:00
|
|
|
*/
|
2025-04-07 16:32:57 +02:00
|
|
|
class AdminerLoginPasswordLess extends Adminer\Plugin {
|
2025-03-11 07:21:13 +01:00
|
|
|
protected $password_hash;
|
2025-02-21 13:53:18 +01:00
|
|
|
|
2018-05-04 16:52:41 +02:00
|
|
|
/** Set allowed password
|
2025-03-28 12:03:56 +01:00
|
|
|
* @param string $password_hash result of password_hash()
|
2018-01-16 16:37:59 +01:00
|
|
|
*/
|
2025-07-28 22:46:31 +02:00
|
|
|
function __construct($password_hash) {
|
2018-01-16 16:37:59 +01:00
|
|
|
$this->password_hash = $password_hash;
|
2016-11-28 10:09:51 -08:00
|
|
|
}
|
2018-05-04 16:52:41 +02:00
|
|
|
|
|
|
|
|
function credentials() {
|
2025-03-05 11:40:56 +01:00
|
|
|
$password = Adminer\get_password();
|
2025-03-06 17:34:21 +01:00
|
|
|
return array(Adminer\SERVER, $_GET["username"], (password_verify($password, $this->password_hash) ? "" : $password));
|
2018-05-04 16:52:41 +02:00
|
|
|
}
|
2025-02-21 13:53:18 +01:00
|
|
|
|
2018-01-16 16:37:59 +01:00
|
|
|
function login($login, $password) {
|
2018-05-04 16:52:41 +02:00
|
|
|
if ($password != "") {
|
2018-01-16 16:37:59 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
2016-11-28 10:09:51 -08:00
|
|
|
}
|
2025-04-07 17:00:59 +02:00
|
|
|
|
2025-04-08 12:57:03 +02:00
|
|
|
protected $translations = array(
|
2025-04-07 17:00:59 +02:00
|
|
|
'cs' => array('' => 'Povolí přihlášení bez hesla'),
|
|
|
|
|
'de' => array('' => 'Ermöglicht die Anmeldung ohne Passwort'),
|
|
|
|
|
'pl' => array('' => 'Włącz logowanie bez hasła'),
|
|
|
|
|
'ro' => array('' => 'Activați autentificarea fără parolă'),
|
2025-04-08 19:34:12 +09:00
|
|
|
'ja' => array('' => 'パスワードなしのログインを許可'),
|
2025-04-07 17:00:59 +02:00
|
|
|
);
|
2016-11-28 10:09:51 -08:00
|
|
|
}
|