1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/9687] Fix ban message for banned users

PHPBB3-9687
This commit is contained in:
Marc Alexander
2023-08-06 13:59:43 +02:00
parent 54bb32bba5
commit e54d54488c
3 changed files with 14 additions and 6 deletions

View File

@@ -554,11 +554,19 @@ class manager
*/
public function get_ban_message(array $ban_row, string $ban_triggered_by, string $contact_link): string
{
$till_date = ($ban_row && $ban_row['end'] > 0) ? $this->user->format_date($ban_row['end']) : '';
if ($ban_row['end'] > 0)
{
$till_date = $this->user->format_date($ban_row['end']);
$ban_type = 'BOARD_BAN_TIME';
}
else
{
$till_date = '';
$ban_type = 'BOARD_BAN_PERM';
}
$ban_type = $ban_row['ban_end'] ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
$message = $this->language->lang($ban_type, $till_date, '<a href="' . $contact_link . '">', '</a>');
$message .= $ban_row['reason'] ? '<br><br>' . $this->language->lang('BOARD_BAN_REASON', $ban_row['reason']) : '';
$message .= !empty($ban_row['reason']) ? '<br><br>' . $this->language->lang('BOARD_BAN_REASON', $ban_row['reason']) : '';
$message .= '<br><br><em>' . $this->language->lang('BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)) . '</em>';
return $message;

View File

@@ -1170,7 +1170,7 @@ class session
if ($banned && !$return)
{
global $phpEx;
global $config, $phpbb_root_path, $phpEx;
// Initiate environment ... since it won't be set at this stage
$this->setup();