1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

fix hierarchy of authentication modules, make everything extend Auth_Base and implement hook_auth_user() for pluginhost

This commit is contained in:
Andrew Dolgov
2021-02-08 19:11:31 +03:00
parent fc2e0bf67b
commit 51d2deeea9
5 changed files with 25 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
<?php
class Auth_Base {
private $pdo;
abstract class Auth_Base extends Plugin implements IAuthModule {
protected $pdo;
const AUTH_SERVICE_API = '_api';
@@ -8,18 +8,9 @@ class Auth_Base {
$this->pdo = Db::pdo();
}
/**
* @SuppressWarnings(unused)
*/
function check_password($owner_uid, $password, $service = '') {
return false;
}
/**
* @SuppressWarnings(unused)
*/
function authenticate($login, $password, $service = '') {
return false;
// compatibility wrapper, because of how pluginhost works (hook name == method name)
function hook_auth_user(...$args) {
return $this->authenticate(...$args);
}
// Auto-creates specified user if allowed by system configuration