Log the name of the CLI user, when actions were done from the CLI.

This commit is contained in:
Jan Böhmer 2023-04-07 22:44:59 +02:00
parent c91a6640ff
commit 6443d8e2bf
6 changed files with 124 additions and 2 deletions

View file

@ -147,11 +147,21 @@ class ShowEventLogCommand extends Command
$target_class = $this->elementTypeNameGenerator->getLocalizedTypeLabel($entry->getTargetClass());
}
if ($entry->getUser()) {
$user = $entry->getUser()->getFullName(true);
} else {
if ($entry->isCLIUser()) {
$user = $entry->getCLIUsername() . ' [CLI]';
} else {
$user = $entry->getUsername() . ' [deleted]';
}
}
$row = [
$entry->getID(),
$entry->getTimestamp()->format('Y-m-d H:i:s'),
$entry->getType(),
$entry->getUser()->getFullName(true),
$user,
$target_class,
$target_name,
];