diff options
author | Joas Schilling <coding@schilljs.com> | 2020-07-27 12:12:11 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-30 09:47:31 +0200 |
commit | 5993bd45f3896cdd1289f3cf59a21f81d9f540cd (patch) | |
tree | b0970f6495aebbec6a0db087f3b1a612f16d1a3d /lib/base.php | |
parent | 2af77b2ed7a2bd28f0c3665dc1c7bc0199b44001 (diff) | |
download | nextcloud-server-5993bd45f3896cdd1289f3cf59a21f81d9f540cd.tar.gz nextcloud-server-5993bd45f3896cdd1289f3cf59a21f81d9f540cd.zip |
Correctly remove usergroup shares on removing group members
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index 6d0790e9285..a491cb11c80 100644 --- a/lib/base.php +++ b/lib/base.php @@ -61,6 +61,7 @@ * */ +use OCP\Group\Events\UserRemovedEvent; use OCP\ILogger; use OCP\Share; use OC\Encryption\HookManager; @@ -897,8 +898,12 @@ class OC { public static function registerShareHooks() { if (\OC::$server->getSystemConfig()->getValue('installed')) { OC_Hook::connect('OC_User', 'post_deleteUser', Hooks::class, 'post_deleteUser'); - OC_Hook::connect('OC_User', 'post_removeFromGroup', Hooks::class, 'post_removeFromGroup'); + OC_Hook::connect('OC_User', 'post_removeFromGroup', Hooks::class, 'post_removeFromGroupLDAP'); OC_Hook::connect('OC_User', 'post_deleteGroup', Hooks::class, 'post_deleteGroup'); + + /** @var \OCP\EventDispatcher\IEventDispatcher $dispatcher */ + $dispatcher = \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class); + $dispatcher->addServiceListener(UserRemovedEvent::class, \OC\Share20\UserRemovedListener::class); } } |