mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 08:25:42 +02:00
Improve feedback for banned users
git-svn-id: file:///svn/phpbb/trunk@3769 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
372c2d65d1
commit
6e3908893d
@ -182,15 +182,14 @@ class session
|
|||||||
$this->data['user_id'] = $user_id = ANONYMOUS;
|
$this->data['user_id'] = $user_id = ANONYMOUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is user banned? Are they excluded?
|
|
||||||
if (!$this->data['user_founder'])
|
if (!$this->data['user_founder'])
|
||||||
{
|
{
|
||||||
$banned = false;
|
$banned = false;
|
||||||
|
|
||||||
$sql = "SELECT ban_ip, ban_userid, ban_email, ban_exclude
|
$sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end
|
||||||
FROM " . BANLIST_TABLE . "
|
FROM ' . BANLIST_TABLE . '
|
||||||
WHERE ban_end >= $current_time
|
WHERE ban_end >= ' . time() . '
|
||||||
OR ban_end = 0";
|
OR ban_end = 0';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
@ -218,10 +217,17 @@ class session
|
|||||||
|
|
||||||
if ($banned)
|
if ($banned)
|
||||||
{
|
{
|
||||||
// TODO
|
// Initiate environment ... since it won't be set at this stage
|
||||||
// Note that at present this doesn't surround the administrator
|
$this->setup();
|
||||||
// text with an appropriate URL
|
|
||||||
trigger_error('BOARD_BANNED');
|
// Determine which message to output
|
||||||
|
$till_date = (!empty($row['ban_end'])) ? $this->format_date($row['ban_end']) : '';
|
||||||
|
$message = (!empty($row['ban_end'])) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM';
|
||||||
|
|
||||||
|
$message = sprintf($this->lang[$message], $till_date, '<a href="mailto:' . $config['board_contact'] . '">', '</a>');
|
||||||
|
// More internal HTML ... :D
|
||||||
|
$message .= (!empty($row['ban_show_reason'])) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $row['ban_show_reason']) : '';
|
||||||
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,7 +396,7 @@ class user extends session
|
|||||||
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
|
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
|
||||||
$this->date_format = $config['default_dateformat'];
|
$this->date_format = $config['default_dateformat'];
|
||||||
$this->timezone = $config['board_timezone'] * 3600;
|
$this->timezone = $config['board_timezone'] * 3600;
|
||||||
$this->dst = 0;
|
$this->dst = $config['board_dst'] * 3600;
|
||||||
|
|
||||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||||
{
|
{
|
||||||
@ -509,6 +515,8 @@ class auth
|
|||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
||||||
|
$this->founder = ($userdata['user_founder']) ? true : false;
|
||||||
|
|
||||||
if (!($this->acl_options = $cache->get('acl_options')))
|
if (!($this->acl_options = $cache->get('acl_options')))
|
||||||
{
|
{
|
||||||
$sql = "SELECT auth_value, is_global, is_local
|
$sql = "SELECT auth_value, is_global, is_local
|
||||||
@ -577,7 +585,7 @@ class auth
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cache[$f][$opt];
|
return ($this->founder) ? true : $cache[$f][$opt];
|
||||||
}
|
}
|
||||||
|
|
||||||
function acl_gets()
|
function acl_gets()
|
||||||
|
@ -124,6 +124,7 @@ CREATE TABLE phpbb_banlist (
|
|||||||
ban_end int(11),
|
ban_end int(11),
|
||||||
ban_exclude tinyint(1) DEFAULT '0' NOT NULL,
|
ban_exclude tinyint(1) DEFAULT '0' NOT NULL,
|
||||||
ban_reason varchar(255),
|
ban_reason varchar(255),
|
||||||
|
ban_give_reason varchar(255),
|
||||||
PRIMARY KEY (ban_id)
|
PRIMARY KEY (ban_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -119,7 +119,10 @@ $lang = array(
|
|||||||
|
|
||||||
'BOARD_DISABLE' => 'Sorry but this board is currently unavailable',
|
'BOARD_DISABLE' => 'Sorry but this board is currently unavailable',
|
||||||
'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes',
|
'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes',
|
||||||
'BOARD_BANNED' => 'You have been banned from this forum<br />Please contact the %sboard administrator%s for more information',
|
'BOARD_BAN_TIME' => 'You have been banned from this board until <b>%1$s</b>.<br /><br />Please contact the %2$sBoard Administrator%3$s for more information.',
|
||||||
|
'BOARD_BAN_PERM' => 'You have been <b>permanently</b> banned from this board.<br /><br />Please contact the %2$sBoard Administrator%3$s for more information.',
|
||||||
|
'BOARD_BAN_REASON' => 'Reason given for ban: <b>%s</b>',
|
||||||
|
|
||||||
'EMAIL_DISABLED' => 'Sorry but all emailing functions have been disabled.',
|
'EMAIL_DISABLED' => 'Sorry but all emailing functions have been disabled.',
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user