diff options
author | Andrew Dolgov <[email protected]> | 2021-02-08 19:11:31 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-08 19:11:31 +0300 |
commit | 51d2deeea911e84ea2e56b78544445de22f881b9 (patch) | |
tree | b4d769ada8fa871667771d0d9ec2c4a607f053bd /classes/auth | |
parent | fc2e0bf67bb279b960fb50060b6a7b59f0e5afb2 (diff) |
fix hierarchy of authentication modules, make everything extend Auth_Base and implement hook_auth_user() for pluginhost
Diffstat (limited to 'classes/auth')
-rw-r--r-- | classes/auth/base.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/classes/auth/base.php b/classes/auth/base.php index 4cbc23589..1b9015fe3 100644 --- a/classes/auth/base.php +++ b/classes/auth/base.php @@ -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 |