Browse Source

Audit log for enabling/disabling a user

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v12.0.0beta1
Joas Schilling 7 years ago
parent
commit
5ee445c54b
No account linked to committer's email address

+ 17
- 0
apps/admin_audit/lib/actions/usermanagement.php View File

@@ -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
*

+ 1
- 0
apps/admin_audit/lib/auditlogger.php View File

@@ -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…
Cancel
Save