aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 18:58:36 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 18:58:36 +0000
commit22389f0d3251c96a06e15b25341ec631acfbb06c (patch)
tree4c9e393b1383f19c267f7e322304699833a0affb /phpBB
parent9b97e57deb6760699fb4d6859957859bf2dbcbea (diff)
downloadforums-22389f0d3251c96a06e15b25341ec631acfbb06c.tar
forums-22389f0d3251c96a06e15b25341ec631acfbb06c.tar.gz
forums-22389f0d3251c96a06e15b25341ec631acfbb06c.tar.bz2
forums-22389f0d3251c96a06e15b25341ec631acfbb06c.tar.xz
forums-22389f0d3251c96a06e15b25341ec631acfbb06c.zip
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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/session.php61
1 files changed, 35 insertions, 26 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index ce066cfd1f..3acb817b99 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -171,39 +171,48 @@ class session
$this->data['user_id'] = $user_id = ANONYMOUS;
}
- // Is user banned? Are they excempt?
- $banned = false;
+ // Is user banned? Are they excluded?
+ if (!$this->data['user_founder'])
+ {
+ $banned = false;
- $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);
+ $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 ((
- ($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'])
+ if ($row = $db->sql_fetchrow($result))
{
- if (!empty($row['ban_exclude']))
- {
- $banned = false;
- break;
- }
- else
+ do
{
- $banned = true;
+ 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']))
+ {
+ $banned = false;
+ break;
+ }
+ else
+ {
+ $banned = true;
+ }
+ }
}
+ while ($row = $db->sql_fetchrow($result));
+
+
}
- }
- $db->sql_freeresult($result);
+ $db->sql_freeresult($result);
- if ($banned)
- {
- trigger_error('You_been_banned');
+ if ($banned)
+ {
+ trigger_error('You_been_banned');
+ }
}
// Is there an existing session? If so, grab last visit time from that