diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-25 16:14:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-25 16:14:52 +0200 |
commit | 8ef25a7628d44465d4777686227407f9a2067700 (patch) | |
tree | 0f54487a0a15731da8f1f2c06c932cfa35ffe777 /apps | |
parent | 5a9224fb4c736fbd07e0dd90058c2e87cbebbe16 (diff) | |
parent | f1522a8dca5e687e9faf6da9f4787c1ea2808d48 (diff) | |
download | nextcloud-server-8ef25a7628d44465d4777686227407f9a2067700.tar.gz nextcloud-server-8ef25a7628d44465d4777686227407f9a2067700.zip |
Merge pull request #4490 from GitHubUser4234/audit_log_group_creation_deletion
Audit group creation/deletion
Diffstat (limited to 'apps')
-rw-r--r-- | apps/admin_audit/lib/actions/groupmanagement.php | 32 | ||||
-rw-r--r-- | apps/admin_audit/lib/auditlogger.php | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/apps/admin_audit/lib/actions/groupmanagement.php b/apps/admin_audit/lib/actions/groupmanagement.php index a341e4de27b..34aec7812c5 100644 --- a/apps/admin_audit/lib/actions/groupmanagement.php +++ b/apps/admin_audit/lib/actions/groupmanagement.php @@ -4,6 +4,7 @@ * * @author Bjoern Schiessle <bjoern@schiessle.org> * @author Lukas Reschke <lukas@statuscode.ch> + * @author Roger Szabo <roger.szabo@web.de> * * @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 20d34655507..a01fec63019 100644 --- a/apps/admin_audit/lib/auditlogger.php +++ b/apps/admin_audit/lib/auditlogger.php @@ -5,6 +5,7 @@ * * @author Bjoern Schiessle <bjoern@schiessle.org> * @author Lukas Reschke <lukas@statuscode.ch> + * @author Roger Szabo <roger.szabo@web.de> * * @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']); } /** |