Skip to content
Permalink
Browse files

Replace username with message for deleted users (#3945)

  • Loading branch information...
LOBsTerr committed Apr 5, 2019
1 parent 05d81f7 commit eeba53590594fad4874a1e718a011b73d1fd119a
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/Command/Database/DatabaseLogBase.php
@@ -197,12 +197,12 @@ protected function makeQuery($offset = null, $range = 1000)
protected function createTableHeader()
{
return [
$this->trans('commands.database.log.common.messages.event-id'),
$this->trans('commands.database.log.common.messages.type'),
$this->trans('commands.database.log.common.messages.date'),
$this->trans('commands.database.log.common.messages.message'),
$this->trans('commands.database.log.common.messages.user'),
$this->trans('commands.database.log.common.messages.severity'),
$this->trans('commands.database.log.common.messages.event-id'),
$this->trans('commands.database.log.common.messages.type'),
$this->trans('commands.database.log.common.messages.date'),
$this->trans('commands.database.log.common.messages.message'),
$this->trans('commands.database.log.common.messages.user'),
$this->trans('commands.database.log.common.messages.severity'),
];
}
@@ -216,7 +216,13 @@ protected function createTableRow(\stdClass $dblog)
/**
* @var User $user
*/
$user = $this->userStorage->load($dblog->uid);
if ($user = $this->userStorage->load($dblog->uid)) {
$user_id = $user->id();
$user_name = $user->getUsername();
} else {
$user_id = $dblog->uid;
$user_name = $this->trans('commands.database.log.common.messages.user-deleted');
}
return [
$dblog->wid,
@@ -228,7 +234,7 @@ protected function createTableRow(\stdClass $dblog)
true,
true
),
$user->getUsername() . ' (' . $user->id() . ')',
$user_name . ' (' . $user_id . ')',
$this->severityList[$dblog->severity]->render(),
];
}

0 comments on commit eeba535

Please sign in to comment.
You can’t perform that action at this time.