diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-06-15 19:32:39 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-06-30 05:15:49 +0000 |
commit | 51cae9ba98d52a27bad5aea8f33af53721c011f2 (patch) | |
tree | f3de164fe0abe0a703f5ad6de20d6b44a66fcff5 /lib/base.php | |
parent | 148a62939f3adddb29942a13d08725b3bdbd76f4 (diff) | |
download | nextcloud-server-51cae9ba98d52a27bad5aea8f33af53721c011f2.tar.gz nextcloud-server-51cae9ba98d52a27bad5aea8f33af53721c011f2.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.php | 6 |
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() { |