summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-11-23 23:59:50 +0100
committerMorris Jobke <hey@morrisjobke.de>2020-11-23 23:59:52 +0100
commit9bf76d2bad08b2e8c8e6bab9f3e514515fb89058 (patch)
tree7b552ca61e16414eb375c3f90765dabd9f9e9efd /lib/private/Server.php
parentd9e0efbf72e1f57abfbfffd3e547ba171e867d78 (diff)
downloadnextcloud-server-9bf76d2bad08b2e8c8e6bab9f3e514515fb89058.tar.gz
nextcloud-server-9bf76d2bad08b2e8c8e6bab9f3e514515fb89058.zip
Streamline user creation and deletion events
CreateUserEvent was the only one that didn't matched the naming scheme of BeforePASTTENSEEvent and PASTTENSEEvent. The event wasn't used at all so this just removes it again as there is BeforeUserCreatedEvent that is also available since 18. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 39524957166..275caf306e2 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -524,33 +524,25 @@ class Server extends ServerContainer implements IServerContainer {
$c->get(ILogger::class),
$c->get(IEventDispatcher::class)
);
+ /** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
-
- /** @var IEventDispatcher $dispatcher */
- $dispatcher = $this->get(IEventDispatcher::class);
- $dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password));
});
+ /** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
/** @var \OC\User\User $user */
\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
});
+ /** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
/** @var \OC\User\User $user */
\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
-
- /** @var IEventDispatcher $dispatcher */
- $dispatcher = $this->get(IEventDispatcher::class);
- $dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user));
});
+ /** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
$userSession->listen('\OC\User', 'postDelete', function ($user) {
/** @var \OC\User\User $user */
\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
-
- /** @var IEventDispatcher $dispatcher */
- $dispatcher = $this->get(IEventDispatcher::class);
- $dispatcher->dispatchTyped(new UserDeletedEvent($user));
});
$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
/** @var \OC\User\User $user */