mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 10:18:56 +02:00
Log the name of the CLI user, when actions were done from the CLI.
This commit is contained in:
parent
c91a6640ff
commit
6443d8e2bf
6 changed files with 124 additions and 2 deletions
|
@ -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,
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue