aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-08-01 19:59:04 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-08-01 19:59:04 +0000
commit4d8f7cd8a527378afe49a0f40e6edfc8346be8c9 (patch)
treef7672212bd488d676e3d490466aabb2a2bc1569a /phpBB/includes
parent21a6090308f033d86fda833668bfb932ea12e95b (diff)
downloadforums-4d8f7cd8a527378afe49a0f40e6edfc8346be8c9.tar
forums-4d8f7cd8a527378afe49a0f40e6edfc8346be8c9.tar.gz
forums-4d8f7cd8a527378afe49a0f40e6edfc8346be8c9.tar.bz2
forums-4d8f7cd8a527378afe49a0f40e6edfc8346be8c9.tar.xz
forums-4d8f7cd8a527378afe49a0f40e6edfc8346be8c9.zip
User, IP and email banning admin functional
git-svn-id: file:///svn/phpbb/trunk@781 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/sessions.php12
2 files changed, 12 insertions, 6 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index a5125c4913..02b5b25dee 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -276,7 +276,7 @@ function init_userprefs($userdata)
if( !defined("TEMPLATE_CONFIG") )
{
- message_die(CRITICAL_MESSAGE, "Couldn't open " . $board_config['default_template'] . " template config file");
+ message_die(CRITICAL_ERROR, "Couldn't open " . $board_config['default_template'] . " template config file");
}
}
@@ -354,7 +354,7 @@ function decode_ip($int_ip)
//
function create_date($format, $gmepoch, $tz)
{
- return (gmdate($format, $gmepoch + (3600 * $tz)));
+ return (@gmdate($format, $gmepoch + (3600 * $tz)));
}
//
@@ -362,7 +362,7 @@ function create_date($format, $gmepoch, $tz)
//
function get_gmt_ts()
{
- $time = time();
+ $time = @time();
return($time);
}
diff --git a/phpBB/includes/sessions.php b/phpBB/includes/sessions.php
index 035bf8b2ea..e25d7561ae 100644
--- a/phpBB/includes/sessions.php
+++ b/phpBB/includes/sessions.php
@@ -30,7 +30,7 @@
function session_begin($user_id, $user_ip, $page_id, $session_length, $login = 0, $autologin = 0)
{
- global $db, $lang, $board_config;
+ global $db, $lang, $board_config, $phpEx;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;
$cookiename = $board_config['cookie_name'];
@@ -57,9 +57,14 @@ function session_begin($user_id, $user_ip, $page_id, $session_length, $login = 0
//
// Initial ban check against IP and userid
//
+ ereg("(..)(..)(..)(..)", $user_ip, $user_ip_parts);
+
$sql = "SELECT ban_ip, ban_userid
- FROM " . BANLIST_TABLE . "
- WHERE ban_ip = '$user_ip'
+ FROM " . BANLIST_TABLE . "
+ WHERE ban_ip = '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "'
+ OR ban_ip = '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff'
+ OR ban_ip = '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff'
+ OR ban_ip = '" . $user_ip_parts[1] . "ffffff'
OR ban_userid = $user_id";
$result = $db->sql_query($sql);
if (!$result)
@@ -74,6 +79,7 @@ function session_begin($user_id, $user_ip, $page_id, $session_length, $login = 0
//
if($ban_info['ban_ip'] || $ban_info['ban_userid'])
{
+ include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
message_die(CRITICAL_MESSAGE, $lang['You_been_banned']);
}
else