Merge pull request #4490 from GitHubUser4234/audit_log_group_creation_deletion

Audit group creation/deletion
This commit is contained in:
Joas Schilling 2017-04-25 16:14:52 +02:00 committed by GitHub
commit 8ef25a7628
2 changed files with 35 additions and 0 deletions

View File

@ -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'
]
);
}
}

View File

@ -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']);
}
/**