summaryrefslogtreecommitdiff
path: root/classes/userhelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/userhelper.php')
-rw-r--r--classes/userhelper.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/classes/userhelper.php b/classes/userhelper.php
index b0a9dc598..4519f2803 100644
--- a/classes/userhelper.php
+++ b/classes/userhelper.php
@@ -7,15 +7,15 @@ class UserHelper {
$user_id = false;
$auth_module = false;
- foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_AUTH_USER) as $plugin) {
-
- $user_id = (int) $plugin->authenticate($login, $password, $service);
-
- if ($user_id) {
- $auth_module = strtolower(get_class($plugin));
- break;
- }
- }
+ PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_AUTH_USER,
+ function ($result, $plugin) use (&$user_id, &$auth_module) {
+ if ($result) {
+ $user_id = (int)$result;
+ $auth_module = strtolower(get_class($plugin));
+ return true;
+ }
+ },
+ $login, $password, $service);
if ($user_id && !$check_only) {