diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 93d5d971b..60f0b16d7 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -31,6 +31,7 @@ class e107 * IPV6 string for localhost - as stored in DB */ const LOCALHOST_IP = '0000:0000:0000:0000:0000:ffff:7f00:0001'; + const LOCALHOST_IP2 = '0000:0000:0000:0000:0000:0000:0000:0001'; public $server_path; diff --git a/e107_handlers/iphandler_class.php b/e107_handlers/iphandler_class.php index d3e8128ff..09a037a59 100644 --- a/e107_handlers/iphandler_class.php +++ b/e107_handlers/iphandler_class.php @@ -64,7 +64,8 @@ class eIPHandler /** * IPV6 string for localhost - as stored in DB */ - const LOCALHOST_IP = '0000:0000:0000:0000:0000:ffff:7f00:0001'; +// const LOCALHOST_IP = '0000:0000:0000:0000:0000:ffff:7f00:0001'; + const BAN_REASON_COUNT = 7; // Update as more ban reasons added (max 10 supported) @@ -834,7 +835,7 @@ class eIPHandler if($this->actionCount) { $ip = $this->getip(); // This will be in normalised IPV6 form - if ($ip != eIPHandler::LOCALHOST_IP) + if ($ip != e107::LOCALHOST_IP && $ip != e107::LOCALHOST_IP2) { // Check host name, user email to see if banned $vals = array(); if (e107::getPref('enable_rdns')) @@ -939,6 +940,13 @@ class eIPHandler */ public function add_ban($bantype, $ban_message = '', $ban_ip = '', $ban_user = 0, $ban_notes = '') { + + if ($ban_ip == e107::LOCALHOST_IP || $ban_ip == e107::LOCALHOST_IP2) + { + return false; + } + + $sql = e107::getDb(); $pref = e107::getPref(); diff --git a/e107_handlers/login.php b/e107_handlers/login.php index b5d5eb75d..295131a1e 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -571,7 +571,7 @@ class userlogin $this->logNote('LAN_ROLL_LOG_10', $username); } - e107::getMessage()->addError($message); + e107::getMessage()->reset()->addError($message); // prevent duplicates. if($this->testMode === true) { diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index 283ccf3f1..a267bf85b 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -212,7 +212,7 @@ class e_online } // Always allow localhost - any problems are usually semi-intentional! - if ((varset($row['online_ip']) != '127.0.0.1') && (varset($row['online_ip']) != e107::LOCALHOST_IP)) + if ((varset($row['online_ip']) != '127.0.0.1') && (varset($row['online_ip']) != e107::LOCALHOST_IP) && (varset($row['online_ip']) != e107::LOCALHOST_IP2)) { // Check for excessive access if ($row['online_pagecount'] > $online_bancount) diff --git a/signup.php b/signup.php index c573dfae8..9bd32b7aa 100644 --- a/signup.php +++ b/signup.php @@ -634,7 +634,7 @@ if (isset($_POST['register']) && intval($pref['user_reg']) === 1) // check for multiple signups from the same IP address. But ignore localhost - if ($allData['user_ip'] != e107::LOCALHOST_IP) + if ($allData['user_ip'] != e107::LOCALHOST_IP && $allData['user_ip'] != e107::LOCALHOST_IP2) { if($ipcount = $sql->select('user', '*', "user_ip='".$allData['user_ip']."' and user_ban !='2' ")) {