aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 18:39:24 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 18:39:24 +0000
commit82b23fdf67e3e94759c28a99cd6b05d70409873f (patch)
tree0752dad56c6969ef9d3d216828ab9ae0a7de0c8d /phpBB/includes
parent493a689b1eddc2d8db2078e487596322ce86dfc2 (diff)
downloadforums-82b23fdf67e3e94759c28a99cd6b05d70409873f.tar
forums-82b23fdf67e3e94759c28a99cd6b05d70409873f.tar.gz
forums-82b23fdf67e3e94759c28a99cd6b05d70409873f.tar.bz2
forums-82b23fdf67e3e94759c28a99cd6b05d70409873f.tar.xz
forums-82b23fdf67e3e94759c28a99cd6b05d70409873f.zip
Enable exclusion from bans for users, IP's or email addresses
git-svn-id: file:///svn/phpbb/trunk@3267 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/session.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 7def737c02..ce066cfd1f 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -171,7 +171,10 @@ class session
$this->data['user_id'] = $user_id = ANONYMOUS;
}
- $sql = "SELECT ban_ip, ban_userid, ban_email
+ // Is user banned? Are they excempt?
+ $banned = false;
+
+ $sql = "SELECT ban_ip, ban_userid, ban_email, ban_exclude
FROM " . BANLIST_TABLE . "
WHERE ban_end >= $current_time
OR ban_end = 0";
@@ -179,16 +182,30 @@ class session
while ($row = $db->sql_fetchrow($result))
{
- if (( $row['user_id'] == $this->data['user_id'] ||
+ 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'])
{
- trigger_error('You_been_banned');
+ if (!empty($row['ban_exclude']))
+ {
+ $banned = false;
+ break;
+ }
+ else
+ {
+ $banned = true;
+ }
}
}
$db->sql_freeresult($result);
+ if ($banned)
+ {
+ trigger_error('You_been_banned');
+ }
+
// 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());