Merge pull request #23931 from nextcloud/backport/23917/stable19
[stable19] Do not emit UserCreatedEvent twice
This commit is contained in:
commit
f97048f0d0
|
@ -224,7 +224,6 @@ use OCP\User\Events\BeforeUserLoggedOutEvent;
|
||||||
use OCP\User\Events\PasswordUpdatedEvent;
|
use OCP\User\Events\PasswordUpdatedEvent;
|
||||||
use OCP\User\Events\PostLoginEvent;
|
use OCP\User\Events\PostLoginEvent;
|
||||||
use OCP\User\Events\UserChangedEvent;
|
use OCP\User\Events\UserChangedEvent;
|
||||||
use OCP\User\Events\UserCreatedEvent;
|
|
||||||
use OCP\User\Events\UserDeletedEvent;
|
use OCP\User\Events\UserDeletedEvent;
|
||||||
use OCP\User\Events\UserLoggedInEvent;
|
use OCP\User\Events\UserLoggedInEvent;
|
||||||
use OCP\User\Events\UserLoggedInWithCookieEvent;
|
use OCP\User\Events\UserLoggedInWithCookieEvent;
|
||||||
|
@ -508,10 +507,6 @@ class Server extends ServerContainer implements IServerContainer {
|
||||||
$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
|
$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
|
||||||
/** @var $user \OC\User\User */
|
/** @var $user \OC\User\User */
|
||||||
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
|
\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) {
|
$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
|
||||||
/** @var $user \OC\User\User */
|
/** @var $user \OC\User\User */
|
||||||
|
|
Loading…
Reference in New Issue