diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-25 17:18:56 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-25 17:20:35 +0200 |
commit | 5ee445c54bbd0f29bfc46dce62ee43a127f483aa (patch) | |
tree | e1c71d56c699f802c68556497a47b7ae344b3268 /apps | |
parent | ac0c21f4a7473396677ab5eb461c660532a1558e (diff) | |
download | nextcloud-server-5ee445c54bbd0f29bfc46dce62ee43a127f483aa.tar.gz nextcloud-server-5ee445c54bbd0f29bfc46dce62ee43a127f483aa.zip |
Audit log for enabling/disabling a user
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/admin_audit/lib/actions/usermanagement.php | 17 | ||||
-rw-r--r-- | apps/admin_audit/lib/auditlogger.php | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/admin_audit/lib/actions/usermanagement.php b/apps/admin_audit/lib/actions/usermanagement.php index 925d8b0a715..0ee192d9a31 100644 --- a/apps/admin_audit/lib/actions/usermanagement.php +++ b/apps/admin_audit/lib/actions/usermanagement.php @@ -61,6 +61,23 @@ class UserManagement extends Action { } /** + * Log enabling of users + * + * @param array $params + */ + public function change(array $params) { + if ($params['feature'] === 'enabled') { + $this->log( + $params['value'] === 'true' ? 'User enabled: "%s"' : 'User disabled: "%s"', + ['user' => $params['user']->getUID()], + [ + 'user', + ] + ); + } + } + + /** * Logs changing of the user scope * * @param IUser $user diff --git a/apps/admin_audit/lib/auditlogger.php b/apps/admin_audit/lib/auditlogger.php index a01fec63019..4e1909c6475 100644 --- a/apps/admin_audit/lib/auditlogger.php +++ b/apps/admin_audit/lib/auditlogger.php @@ -90,6 +90,7 @@ class AuditLogger { Util::connectHook('OC_User', 'post_createUser', $userActions, 'create'); Util::connectHook('OC_User', 'post_deleteUser', $userActions, 'delete'); + Util::connectHook('OC_User', 'changeUser', $userActions, 'change'); $this->userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']); } |