From 34fa4138fb5c5f4e469d0b74b8773ce5d5f34609 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Thu, 20 Jul 2023 15:42:26 +0200 Subject: [PATCH] Add group events to UpdateGroups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Jobs/UpdateGroups.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 2c3ce457cff..1ae8e5fcd6b 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -189,6 +189,10 @@ class UpdateGroups extends TimedJob { foreach ($users as $user) { $this->groupMembershipMapper->insert(GroupMembership::fromParams(['groupid' => $createdGroup,'userid' => $user])); } + $groupObject = $this->groupManager->get($group); + if ($groupObject instanceof IGroup) { + $this->dispatcher->dispatchTyped(new GroupCreatedEvent($groupObject)); + } } $this->logger->debug( 'bgJ "updateGroups" – FINISHED dealing with created Groups.', @@ -207,6 +211,9 @@ class UpdateGroups extends TimedJob { ); $this->groupMembershipMapper->deleteGroups($removedGroups); + + //TODO find a way to dispatch GroupDeletedEvent + $this->logger->info( 'bgJ "updateGroups" – groups {removedGroups} were removed.', [ -- 2.39.5