1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-04 14:47:52 +02:00

[ticket/9687] Use new array entries for bans

PHPBB3-9687
This commit is contained in:
Marc Alexander 2023-07-04 14:48:21 +02:00
parent 3563f20991
commit 9048aed163
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
4 changed files with 19 additions and 16 deletions

View File

@ -1493,7 +1493,7 @@ function validate_user_email($email, $allowed_email = false)
$ban = $user->check_ban(false, false, $email, true);
if (!empty($ban))
{
return !empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : 'EMAIL_BANNED';
return !empty($ban['reason']) ? $ban['reason'] : 'EMAIL_BANNED';
}
if (!$config['allow_emailreuse'])

View File

@ -1204,7 +1204,7 @@ class session
}
// Determine which message to output
$till_date = ($ban_row['end'] > 0) ? $this->format_date($ban_row['end']) : '';
$till_date = ($ban_row && $ban_row['end'] > 0) ? $this->format_date($ban_row['end']) : '';
$message = $this->get_ban_message($ban_row, $ban_triggered_by);
$contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);

View File

@ -879,12 +879,12 @@ class user extends \phpbb\session
{
global $config, $phpbb_root_path, $phpEx;
$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';
$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
$till_date = ($ban_row['end']) ? $this->format_date($ban_row['end']) : '';
$message = ($ban_row['end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
$contact_link = phpbb_get_board_contact_link($config, $phpbb_root_path, $phpEx);
$message = $this->language->lang($message, $till_date, '<a href="' . $contact_link . '">', '</a>');
$message .= ($ban_row['ban_give_reason']) ? '<br><br>' . $this->language->lang('BOARD_BAN_REASON', $ban_row['ban_give_reason']) : '';
$message .= ($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

@ -1,26 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_banlist">
<table name="phpbb_bans">
<column>ban_id</column>
<column>ban_userid</column>
<column>ban_exclude</column>
<column>ban_mode</column>
<column>ban_item</column>
<column>ban_start</column>
<column>ban_end</column>
<column>ban_email</column>
<column>ban_give_reason</column>
<column>ban_reason</column>
<column>ban_reason_display</column>
<row>
<value>1</value>
<value>0</value>
<value>0</value>
<value>0</value>
<value>email</value>
<value>banned@example.com</value>
<value>0</value>
<value>0</value>
<value></value>
<value></value>
</row>
<row>
<value>2</value>
<value>0</value>
<value>0</value>
<value>0</value>
<value>email</value>
<value>banned2@example.com</value>
<value>0</value>
<value>0</value>
<value>just because</value>
<value>just because</value>
</row>
</table>