From f1522a8dca5e687e9faf6da9f4787c1ea2808d48 Mon Sep 17 00:00:00 2001 From: Roger Szabo Date: Tue, 25 Apr 2017 19:06:49 +0800 Subject: [PATCH] 4190 Signed-off-by: Roger Szabo --- .../lib/actions/groupmanagement.php | 32 +++++++++++++++++++ apps/admin_audit/lib/auditlogger.php | 3 ++ 2 files changed, 35 insertions(+) diff --git a/apps/admin_audit/lib/actions/groupmanagement.php b/apps/admin_audit/lib/actions/groupmanagement.php index a341e4de27..34aec7812c 100644 --- a/apps/admin_audit/lib/actions/groupmanagement.php +++ b/apps/admin_audit/lib/actions/groupmanagement.php @@ -4,6 +4,7 @@ * * @author Bjoern Schiessle * @author Lukas Reschke + * @author Roger Szabo * * @license GNU AGPL version 3 or any later version * @@ -72,5 +73,36 @@ class GroupManagement extends Action { ] ); } + + /** + * log create group to group event + * + * @param IGroup $group + */ + public function createGroup(IGroup $group) { + $this->log('Group created: "%s"', + [ + 'group' => $group->getGID() + ], + [ + 'group' + ] + ); + } + /** + * log delete group to group event + * + * @param IGroup $group + */ + public function deleteGroup(IGroup $group) { + $this->log('Group deleted: "%s"', + [ + 'group' => $group->getGID() + ], + [ + 'group' + ] + ); + } } diff --git a/apps/admin_audit/lib/auditlogger.php b/apps/admin_audit/lib/auditlogger.php index 20d3465550..a01fec6301 100644 --- a/apps/admin_audit/lib/auditlogger.php +++ b/apps/admin_audit/lib/auditlogger.php @@ -5,6 +5,7 @@ * * @author Bjoern Schiessle * @author Lukas Reschke + * @author Roger Szabo * * @license GNU AGPL version 3 or any later version * @@ -96,6 +97,8 @@ class AuditLogger { $groupActions = new GroupManagement($this->logger); $this->groupManager->listen('\OC\Group', 'postRemoveUser', [$groupActions, 'removeUser']); $this->groupManager->listen('\OC\Group', 'postAddUser', [$groupActions, 'addUser']); + $this->groupManager->listen('\OC\Group', 'postDelete', [$groupActions, 'deleteGroup']); + $this->groupManager->listen('\OC\Group', 'postCreate', [$groupActions, 'createGroup']); } /**