aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-11-10 21:58:37 +0100
committerMorris Jobke <hey@morrisjobke.de>2020-11-10 21:58:44 +0100
commite187c1d77887569f3113cb9191c303a53d8944b6 (patch)
tree8ceb3dd2f2464b0dcfd5a4c5995307af1e012e8f /lib
parent03b436c0006f0362079c0978053c0a996e92c09f (diff)
downloadnextcloud-server-e187c1d77887569f3113cb9191c303a53d8944b6.tar.gz
nextcloud-server-e187c1d77887569f3113cb9191c303a53d8944b6.zip
Remove old OC_Hook for OC_Group events
Those mappings exist and we will remove the first ones (labeled as `old`): old: `\OC_Hook::listen('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preCreate', function ($gid) { ... });` since NC 17 (#18350): `OCP\Group\Events\BeforeGroupCreatedEvent` old: `\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { ... });` since NC 17 (#18350): `OCP\Group\Events\GroupCreatedEvent` old: `\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { ... });` since NC 17 (#18350): `OCP\Group\Events\BeforeGroupDeletedEvent` old: `\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { ... });` since NC 17 (#18350): `OCP\Group\Events\GroupDeletedEvent` old: `\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { ... });` since NC 17 (#18350): `OCP\Group\Events\BeforeUserAddedEvent` old: `\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));` since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { ... });` since NC 17 (#18350): `OCP\Group\Events\UserAddedEvent` Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 4ec90574740..1a2085fa0bc 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -433,45 +433,31 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
$groupManager = new \OC\Group\Manager($this->get(IUserManager::class), $c->get(SymfonyAdapter::class), $this->get(ILogger::class));
$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
- \OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
});
$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
});
$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
});
$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
});
$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
- \OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
});
$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
- \OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
- //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
- \OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
-
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));