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:
Paul S. Owen 2003-01-07 18:58:36 +00:00
parent 9b97e57deb
commit 22389f0d32

View file

@ -171,7 +171,9 @@ 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?
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
@ -180,14 +182,16 @@ class session
OR ban_end = 0"; OR ban_end = 0";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
if (( do
($row['user_id'] == $this->data['user_id']) ||
($row['ban_ip'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $this->ip)) ||
($row['ban_email'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $this->data['user_email'])))
&& !$this->data['user_founder'])
{ {
print_r($row);
if ((intval($row['ban_userid']) == $this->data['user_id']) ||
(!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $this->ip)) ||
(!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $this->data['user_email'])))
{
if (!empty($row['ban_exclude'])) if (!empty($row['ban_exclude']))
{ {
$banned = false; $banned = false;
@ -198,6 +202,10 @@ class session
$banned = true; $banned = true;
} }
} }
}
while ($row = $db->sql_fetchrow($result));
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -205,6 +213,7 @@ class session
{ {
trigger_error('You_been_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
$this->data['session_last_visit'] = ($this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time()); $this->data['session_last_visit'] = ($this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());