summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-15 19:32:39 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-30 00:41:11 +0200
commit638c04d6e08a9a1d859398a219771c08e0dcabf3 (patch)
tree668bbcc9ccfcefd9bb93ceb00aa1792cb22c7ebd /lib/base.php
parentd109d4f58198b2ac35d590e59a45f948da23ca8e (diff)
downloadnextcloud-server-638c04d6e08a9a1d859398a219771c08e0dcabf3.tar.gz
nextcloud-server-638c04d6e08a9a1d859398a219771c08e0dcabf3.zip
accounts event handler to use eventdispatcher, DI and Accounts API
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index 20065006a8c..473a3419cb1 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -68,6 +68,7 @@ use OCP\Share;
use OC\Encryption\HookManager;
use OC\Files\Filesystem;
use OC\Share20\Hooks;
+use OCP\User\Events\UserChangedEvent;
require_once 'public/Constants.php';
@@ -843,8 +844,9 @@ class OC {
}
private static function registerAccountHooks() {
- $hookHandler = \OC::$server->get(\OC\Accounts\Hooks::class);
- \OCP\Util::connectHook('OC_User', 'changeUser', $hookHandler, 'changeUserHook');
+ /** @var IEventDispatcher $dispatcher */
+ $dispatcher = \OC::$server->get(IEventDispatcher::class);
+ $dispatcher->addServiceListener(UserChangedEvent::class, \OC\Accounts\Hooks::class);
}
private static function registerAppRestrictionsHooks() {