Emit audit log upon impersonation.

This commit is contained in:
flash 2023-07-28 23:23:45 +00:00
parent 934b016541
commit 61daa21d3a
2 changed files with 3 additions and 0 deletions

View file

@ -58,6 +58,7 @@ if(CSRF::validateRequest() && $canEdit) {
}
if($allowToImpersonate) {
$msz->createAuditLog('USER_IMPERSONATE', [$userInfo->getId(), $userInfo->getUsername()]);
$authToken->setImpersonatedUserId($userInfo->getId());
$authToken->applyCookie();
url_redirect('index');

View file

@ -135,5 +135,7 @@ class AuditLogInfo {
'ROLE_CREATE' => 'Created role #%d.',
'ROLE_UPDATE' => 'Updated role #%d.',
'USER_IMPERSONATE' => 'Impersonated user #%d %s.',
];
}