mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
This one has the enormous benefit of actually doing what it was supposed to do ...
git-svn-id: file:///svn/phpbb/trunk@3269 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9b97e57deb
commit
22389f0d32
1 changed files with 38 additions and 29 deletions
|
@ -171,39 +171,48 @@ class session
|
||||||
$this->data['user_id'] = $user_id = ANONYMOUS;
|
$this->data['user_id'] = $user_id = ANONYMOUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is user banned? Are they excempt?
|
// Is user banned? Are they excluded?
|
||||||
$banned = false;
|
if (!$this->data['user_founder'])
|
||||||
|
|
||||||
$sql = "SELECT ban_ip, ban_userid, ban_email, ban_exclude
|
|
||||||
FROM " . BANLIST_TABLE . "
|
|
||||||
WHERE ban_end >= $current_time
|
|
||||||
OR ban_end = 0";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
{
|
||||||
if ((
|
$banned = false;
|
||||||
($row['user_id'] == $this->data['user_id']) ||
|
|
||||||
($row['ban_ip'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $this->ip)) ||
|
$sql = "SELECT ban_ip, ban_userid, ban_email, ban_exclude
|
||||||
($row['ban_email'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $this->data['user_email'])))
|
FROM " . BANLIST_TABLE . "
|
||||||
&& !$this->data['user_founder'])
|
WHERE ban_end >= $current_time
|
||||||
|
OR ban_end = 0";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
if (!empty($row['ban_exclude']))
|
do
|
||||||
{
|
{
|
||||||
$banned = false;
|
print_r($row);
|
||||||
break;
|
if ((intval($row['ban_userid']) == $this->data['user_id']) ||
|
||||||
}
|
(!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $this->ip)) ||
|
||||||
else
|
(!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $this->data['user_email'])))
|
||||||
{
|
{
|
||||||
$banned = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($banned)
|
if (!empty($row['ban_exclude']))
|
||||||
{
|
{
|
||||||
trigger_error('You_been_banned');
|
$banned = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$banned = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ($row = $db->sql_fetchrow($result));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($banned)
|
||||||
|
{
|
||||||
|
trigger_error('You_been_banned');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is there an existing session? If so, grab last visit time from that
|
// Is there an existing session? If so, grab last visit time from that
|
||||||
|
|
Loading…
Add table
Reference in a new issue