diff --git a/install/index.php b/install/index.php index a82d163d..8226b385 100644 --- a/install/index.php +++ b/install/index.php @@ -189,14 +189,14 @@ clearstatcache(); if(is_writable(CACHE) && (MYAAC_OS != 'WINDOWS' || win_is_writable(CACHE))) { if(!file_exists(BASE . 'install/ip.txt')) { $content = warning('AAC installation is disabled. To enable it make file ip.txt in install/ directory and put there your IP.
- Your IP is:
' . $_SERVER['REMOTE_ADDR'] . '', true); + Your IP is:
' . get_browser_real_ip() . '', true); } else { $file_content = trim(file_get_contents(BASE . 'install/ip.txt')); $allow = false; $listIP = preg_split('/\s+/', $file_content); foreach($listIP as $ip) { - if($_SERVER['REMOTE_ADDR'] == $ip) { + if(get_browser_real_ip() == $ip) { $allow = true; } } diff --git a/system/libs/forum.php b/system/libs/forum.php index 4922a9c3..c7d7c438 100644 --- a/system/libs/forum.php +++ b/system/libs/forum.php @@ -71,7 +71,7 @@ class Forum 'post_smile' => 0, 'post_html' => 1, 'post_date' => time(), 'last_edit_aid' => 0, 'edit_date' => 0, - 'post_ip' => $_SERVER['REMOTE_ADDR'] + 'post_ip' => get_browser_real_ip() ))) { $thread_id = $db->lastInsertId(); $db->query("UPDATE `" . FORUM_TABLE_PREFIX . "forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id); @@ -93,7 +93,7 @@ class Forum 'post_smile' => $smile, 'post_html' => $html, 'post_date' => time(), - 'post_ip' => $_SERVER['REMOTE_ADDR'] + 'post_ip' => get_browser_real_ip() )); } public static function add_board($name, $description, $access, $guild, &$errors) diff --git a/system/libs/visitors.php b/system/libs/visitors.php index b8b80dba..35a36568 100644 --- a/system/libs/visitors.php +++ b/system/libs/visitors.php @@ -33,7 +33,7 @@ class Visitors $this->sessionTime = $sessionTime; $this->cleanVisitors(); - $ip = $_SERVER['REMOTE_ADDR']; + $ip = get_browser_real_ip(); if($this->visitorExists($ip)) $this->updateVisitor($ip, $_SERVER['REQUEST_URI']); else diff --git a/system/login.php b/system/login.php index 1037c3bf..ef2aa7e7 100644 --- a/system/login.php +++ b/system/login.php @@ -74,7 +74,7 @@ else else $tmp = array(); - $ip = $_SERVER['REMOTE_ADDR']; + $ip = get_browser_real_ip(); $t = isset($tmp[$ip]) ? $tmp[$ip] : NULL; } diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php index 23ee4039..a32408da 100644 --- a/system/pages/createaccount.php +++ b/system/pages/createaccount.php @@ -294,7 +294,7 @@ if($config['account_country_recognize']) { $country_recognized = $country_session; } else { - $info = json_decode(@file_get_contents('http://ipinfo.io/' . $_SERVER['REMOTE_ADDR'] . '/geo'), true); + $info = json_decode(@file_get_contents('http://ipinfo.io/' . get_browser_real_ip() . '/geo'), true); if(isset($info['country'])) { $country_recognized = strtolower($info['country']); setSession('country', $country_recognized); diff --git a/system/pages/forum/new_thread.php b/system/pages/forum/new_thread.php index 0369852a..309422b9 100644 --- a/system/pages/forum/new_thread.php +++ b/system/pages/forum/new_thread.php @@ -65,7 +65,7 @@ if(Forum::canPost($account_logged)) } if (count($errors) == 0) { $saved = true; - $db->query("INSERT INTO `" . FORUM_TABLE_PREFIX . "forum` (`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile`, `post_html` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('0', '" . time() . "', '" . (int)$section_id . "', '0', '0', '" . $account_logged->getId() . "', '" . (int)$char_id . "', " . $db->quote($text) . ", " . $db->quote($post_topic) . ", '" . (int)$smile . "', '" . (int)$html . "', '" . time() . "', '0', '0', '" . $_SERVER['REMOTE_ADDR'] . "')"); + $db->query("INSERT INTO `" . FORUM_TABLE_PREFIX . "forum` (`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile`, `post_html` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('0', '" . time() . "', '" . (int)$section_id . "', '0', '0', '" . $account_logged->getId() . "', '" . (int)$char_id . "', " . $db->quote($text) . ", " . $db->quote($post_topic) . ", '" . (int)$smile . "', '" . (int)$html . "', '" . time() . "', '0', '0', '" . get_browser_real_ip() . "')"); $thread_id = $db->lastInsertId(); $db->query("UPDATE `" . FORUM_TABLE_PREFIX . "forum` SET `first_post`=" . (int)$thread_id . " WHERE `id` = " . (int)$thread_id); header('Location: ' . getForumThreadLink($thread_id));