The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Proxy to Real IP Conversion Details »» | |||||||||||||||||||||||||
This modification is no longer available or supported. This hack makes the forum always use the members real ip when a proxy is detected, meaning that all existing ip functions should continue to work, basically ignoring the proxy server (other than recording it's presence). i.e. * The real ip (or host) is displayed in the who's online page. * The real and proxy server ip's are accesible for each post, the button is red for members using a proxy server. * The real ip is searchable in the admin/mod cp (but not the proxy ip). * The real ip can be banned by admins. etc etc ...... Note: Obviously this hack relies on the proxy server passing the correct http variables to allow detection. If a proxy is detected, then a red ip icon is displayed instead of the standard one. This mod will also detect if the ipinfo hack is installed and adjust itself to call the ipinfo code. History: v2.20 : Updated for vb 3.6. IP Info detection added. v2.21 : Dependancies updated for 3.6.0 Gold. v2.22 : Updated for Version Checking. v2.23 : Fixed bug causing wrong ip in WOL display. v2.24 : Rewritten slightly to fix a minor issue with spiders. v2.25 : Updated for changes in vB 3.6.4. Remember that this modification involves changes to the class_core.php file - if you upgrade your vbulletin, you must reapply those changes. Please do not post asking why this does not work with some proxy servers, the answer is already in the notes above, and also in Post #160. Show Your Support
|
Comments |
#202
|
|||
|
|||
Ugh.... vB 3.6.4 already comes with this built in.
So am I overwriting whats in 3.6.4? I see a similar code EX BELOW: ONE THAT COMES WITH VB 3.6.4 Code:
/** * Fetches an alternate IP address of the current visitor, attempting to detect proxies etc. * * @return string */ function fetch_alt_ip() { $alt_ip = $_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_CLIENT_IP'])) { $alt_ip = $_SERVER['HTTP_CLIENT_IP']; } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) { // make sure we dont pick up an internal IP defined by RFC1918 foreach ($matches[0] AS $ip) { if (!preg_match("#^(10|172\.16|192\.168)\.#", $ip)) { $alt_ip = $ip; break; } } } else if (isset($_SERVER['HTTP_FROM'])) { $alt_ip = $_SERVER['HTTP_FROM']; } return $alt_ip; } Code:
/* Paul M - Try to detect real ip when proxy is in use. */ function fetch_real_ip() { $real_ip = ''; $ignoreprivate = false; if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $real_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else if (isset($_SERVER['HTTP_CLIENT_IP'])) { $real_ip = $_SERVER['HTTP_CLIENT_IP']; } else if (isset($_SERVER['HTTP_FROM'])) { $real_ip = $_SERVER['HTTP_FROM']; } if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $real_ip, $iplist)) { $real_ip = $iplist[0]; if ($ignoreprivate AND preg_match("#^(127|10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168|169\.254)\.#", $real_ip)) { $real_ip = ''; } } else { $real_ip = ''; } return $real_ip; } |
#203
|
||||
|
||||
I know what's built in If you want to use this then follow the instructions.
|
#204
|
|||
|
|||
<a href="http://www.vbulletin.com/forum/showthread.php?p=1260425#post1260425" target="_blank">http://www.vbulletin.com/forum/showt...25#post1260425</a>
Whole site crashed... after doing those specific edits to class_core.php |
#205
|
||||
|
||||
That error has nothing to do with this mod, or any edits to class_core.php (as you proved yourself by uploading the original). That is a basic mysql connection error meaning the database/user/password in your config.php is being rejected by the server.
|
#206
|
||||
|
||||
How can i make it hide for Moderators ??
Thanks |
#207
|
|||
|
|||
Quote:
As soon after.. i edited the class_core.php with the hack the site had a DB error. I checked the sites email and it said it was from class_core.php Line 237 (i think thats the number..) IM NOT KNOCKING YOUR HACKS.. I just found it...rather..funny..thats all.. This is a great hack and you make good hacks that ive seen.. but hopefully you understood to a point were I came from seeing I didnt understand why that specific file I edited with the hack happened to be the same one throwing the site of or whatever. Thanks Paul |
#208
|
||||
|
||||
I don't remember which mod it was, but after installing one and editing some file or another my site went down (I just got a white page). Turned out I had left a single bracket out when making the edits. Are you positive you made all your edits 100% correctly? Those darn php files are so picky.
|
#209
|
|||
|
|||
Hi Paul,
Thank you for this addon. The proxy is using the following HTTP HEADER X-Remote-Addr May i know how do i edit your script? Thank you Edy |
#210
|
||||
|
||||
As far as I can tell, X-Remote-Addr is not the ip address of the client, but the ip address of the proxy server, therefore it is not much use in this code as you already know the proxy server ip. This is designed to pick out the headers giving the client ip.
|
#211
|
|||
|
|||
Paul... youll be happier to know that this hack did indeed install properly this time.. we did alot of troubleshooting and it was infact our password being the same as our WHM's which infact was the server host's fault as we were misinformed.
So... needless to say.. great hack as you know..! I assumed wrong at the time of the install (long story).. just keep making good hacks!. peace. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|