From ed46c5c94aba3573622982d3f93455b741e25519 Mon Sep 17 00:00:00 2001 From: Tobias Assmann Date: Wed, 4 Nov 2020 09:11:20 +0100 Subject: [PATCH 1/2] fix: no more translation from postCreateUser hook to UserCreatedEvent anymore, as event is already emitted in user manager Signed-off-by: Tobias Assmann --- lib/private/Server.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/private/Server.php b/lib/private/Server.php index 224ef68a7c..d7a590dfa0 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -508,10 +508,6 @@ class Server extends ServerContainer implements IServerContainer { $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { /** @var $user \OC\User\User */ \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]); - - /** @var IEventDispatcher $dispatcher */ - $dispatcher = $this->query(IEventDispatcher::class); - $dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); }); $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { /** @var $user \OC\User\User */ From dff10238deed45144bbb6b0fe002ee915d1e238e Mon Sep 17 00:00:00 2001 From: Tobias Assmann Date: Thu, 5 Nov 2020 08:51:14 +0100 Subject: [PATCH 2/2] fix: also remove use statement of UserCreatedEvent Signed-off-by: Tobias Assmann --- lib/private/Server.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/private/Server.php b/lib/private/Server.php index d7a590dfa0..6ad9797641 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -224,7 +224,6 @@ use OCP\User\Events\BeforeUserLoggedOutEvent; use OCP\User\Events\PasswordUpdatedEvent; use OCP\User\Events\PostLoginEvent; use OCP\User\Events\UserChangedEvent; -use OCP\User\Events\UserCreatedEvent; use OCP\User\Events\UserDeletedEvent; use OCP\User\Events\UserLoggedInEvent; use OCP\User\Events\UserLoggedInWithCookieEvent;