Audit log for enabling/disabling a user
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ac0c21f4a7
commit
5ee445c54b
|
@ -60,6 +60,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
|
||||
*
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue