diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php index 1daf9f18ef07b..c6cd853547f29 100644 --- a/apps/admin_audit/lib/AppInfo/Application.php +++ b/apps/admin_audit/lib/AppInfo/Application.php @@ -119,6 +119,7 @@ private function registerHooks(IAuditLogger $logger, $this->versionsHooks($logger); $this->securityHooks($logger, $eventDispatcher); + $this->tagHooks($logger, $eventDispatcher); } private function userManagementHooks(IAuditLogger $logger, @@ -189,6 +190,13 @@ private function consoleHooks(IAuditLogger $logger, $appActions->runCommand($event->getArguments()); }); } + private function tagHooks(IAuditLogger $logger, + IEventDispatcher $eventDispatcher): void { + $eventDispatcher->addListener(\OCP\SystemTag\ManagerEvent::EVENT_CREATE, function (\OCP\SystemTag\ManagerEvent $event) use ($logger) { + $appActions = new Console($logger); + $appActions->runCommand([$event->getTag()->getName()]); + }); + } private function fileHooks(IAuditLogger $logger, IEventDispatcher $eventDispatcher): void {