PDA

View Full Version : Administrative and Maintenance Tools - Proxy to Real IP Conversion


Pages : [1] 2

Paul M
01-01-2010, 10:00 PM
--------------------------------------------------------------------------------
This modification has been withdrawn.
vBulletin 4.0.x and 4.1.x are no longer supported.

For vBulletin 4.2.x please use the built in reverse proxy detection.
--------------------------------------------------------------------------------


This hack makes the forum always use the members real ip if 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).

For example ;

* The real ip 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.

Note: This hack relies on the proxy server passing the correct http variables to allow detection.
If they are not passed then detection will not work. By definition, annonymous proxies do not pass on these variables.

If a proxy is detected, then a red ip icon is displayed instead of the standard one.

To install, download and unzip the files and follow the instructions in the text file.

This modification involves changes to the class_core.php file - if you upgrade your vbulletin, you must reapply those changes.
If you forget these edits, the modification will continue to work for forum posts only (v4.0.4 +).


History:

v4.0.1 : 02-Jan-2010 : Initial release for vb 4.0.0 Gold.
v4.0.2 : 04-Jan-2010 : Added check for invalid alt ip address.
v4.0.3 : 13-Jan-2010 : Minor change to cope better when people forget the class_core file edits.
v4.0.4 : 15-Jan-2010 : Further changes to process forum posts when people forget the class_core file edits.
v4.0.5 : 20-Feb-2010 : Internal update, not released.
v4.0.6 : 27-Feb-2010 : Style code updates for vB 4.0.2.
v4.0.7 : 30-Oct-2010 : Style code updated to work when css stored as files.

v4.1.0 : 04-Dec-2010 : Updated for vBulletin 4.1.x

v4.1.7.0 : 16-Oct-2011 : Updated for vBulletin 4.1.7.
v4.1.8.0 : 18-Nov-2011 : Updated for vBulletin 4.1.8.

v4.2.0.0 : 24-May-2012 : Updated for vBulletin 4.2.0.
v4.2.0.1 : 02-Jan-2015 : Updated for Cloudflare Changes.

RDX1
01-02-2010, 02:02 AM
Nice. :)

Charlie98902
01-02-2010, 02:04 AM
Tagged. Hope this is an easier install than the 3.x one was.

Super Jinni
01-02-2010, 02:12 AM
I was wondering if this mod for vB4.x.
Thanks for updating, Paul!

Hornstar
01-02-2010, 02:29 AM
Tagged. Hope this is an easier install than the 3.x one was.

Looks to be the same as last time "Remember that this modification involves changes to the class_core.php file - if you upgrade your vbulletin, you must reapply those changes."

I was hoping that change would no longer be needed since I forget to update that file after each upgrade lol

Well thanks for the update. tagged for when I upgrade to vb4.

Alecsmith
01-02-2010, 06:12 AM
Nice work Paul :)

Merjawy
01-02-2010, 07:01 AM
Once again.. another update for a great mod..

Thanks

Paul M
01-02-2010, 10:23 AM
I was hoping that change would no longer be needed since I forget to update that file after each upgrade lol
Its impossible to do it without file edits, since it involves php constants which once set cannot be altered (and I dont think the hook system is even initialised at the point the ip address information is extracted). I have managed to reduce it to just one edit this time though, instead of four.

Hasanudin
01-02-2010, 11:46 AM
thx paul, installed :)

Alibass
01-02-2010, 03:04 PM
Great mod Paul and thanks, installed.

linuxututs
01-02-2010, 03:47 PM
Thanks again for another great Mod. Had this installed on last board also.

Thanks,

KevinGupta
01-03-2010, 04:31 AM
I just like direct products/like to upload but not like to replace/edit codes.. :(
thanks for this mod :D

sherwood
01-03-2010, 12:26 PM
Does this work for web proxies aswell like hidemyass.com?

Paul M
01-03-2010, 01:20 PM
Read the notes ;

This hack relies on the proxy server passing the correct http variables to allow detection. If they are not passed then detection will not work. By definition, annonymous proxies do not pass on these variables.

sherwood
01-03-2010, 02:12 PM
Sorry, I read that and wasn't 100% sure whether annonymous proxies meant web bassed proxies.

Thanks anyway

Deviant K1
01-03-2010, 03:36 PM
Been waiting for this :)

INSTALLED!

Thanks Paul :)

Paul M
01-04-2010, 09:04 PM
4.0.2 Released.

This updates the code in the file edit, therefore to upgrade you need to re-do the edit to class_core.php as well as load the new product. IMO, its best to start with a clean copy of the original file and edit it again.

Alexandre.R
01-07-2010, 04:47 AM
4.0.2 Released.

This updates the code in the file edit, therefore to upgrade you need to re-do the edit to class_core.php as well as load the new product. IMO, its best to start with a clean copy of the original file and edit it again.

Alright things.
Updated :)

Dr.osamA
01-07-2010, 05:20 AM
installed

thanxx
________
HANDJOB VIRTUAL (http://www.++++tube.com/categories/691/virtual/videos/1)

johnny713
02-26-2010, 05:18 AM
Paul, can I ask you this before I install? Long time ago, I got a friend. He's using some kind of mod like this about real ip thing. And he said the mod make the database expand bigger superfast. It's that true? Is this mod going to do expand the database bigger really fast? And does it slow down any forum performing?

Paul M
02-26-2010, 11:15 AM
No, thats not true.

daveaite
02-26-2010, 01:53 PM
Great Mod. 5 Stars. Installed.

Kyoshokid
02-28-2010, 12:37 PM
Love it thanks.

One question, whats it mean when it says host name: . ?

https://vborg.vbsupport.ru/external/2010/02/4.png

Thanks in advance.

ximcix
03-15-2010, 09:13 PM
Installed!!!
waiting to see how well it works

bsalu
03-29-2010, 05:15 AM
Hey,

I installed this mod on 4.0.2 PL2 but i dont see any difference.. followed your instruction step by step.

I have registred new member from proxy for test it. It doesnt show real ip and/or IP icon didnt turn to red.

Any help?

Thanks

skol
03-29-2010, 06:53 AM
Hey,

I installed this mod on 4.0.2 PL2 but i dont see any difference.. followed your instruction step by step.

I have registred new member from proxy for test it. It doesnt show real ip and/or IP icon didnt turn to red.

Any help?

Thanks

Note: This hack relies on the proxy server passing the correct http variables to allow detection. If they are not passed then detection will not work. By definition, annonymous proxies do not pass on these variables.

Deviant K1
04-12-2010, 02:00 PM
I wasn't sure if anyone knew this but if you downloaded & installed the latest vBulletin 4.03 Maintenance Release, you would not have to edit your class_core.php file with the replacement script that Paul had instructed in the "Proxy-to-real-ip" text doc.

This script has been added into the vb-4.03 class_core.php.

Paul M
04-12-2010, 02:19 PM
What ? Im pretty sure thats unlikely.

Please clarify exactly what you think has been added to the default class_core.php.

Deviant K1
04-12-2010, 04:00 PM
What ? Im pretty sure thats unlikely.

Please clarify exactly what you think has been added to the default class_core.php.

My apologizes Paul M and to everyone else. The post was a SERIOUS blunder!

It would seem that my assistant site admin, who helps me with the upgrades/updates from time to time mis-read (or got confused) on the version of vB class_core.php file. It wasn't until I re-check it that I noticed the error. Unfortunately, Paul M. beat me to the correction LOL!

Thanks Paul for pointing that out none the less :)

Our apologizes to the community :)

Paul M
04-12-2010, 06:37 PM
LOL, No prob - I knew it had to be a mistake ;)

mmacrypt
04-14-2010, 12:58 AM
Ok, I got it installed and think it's installed correctly. I will keep an eye for anybody using a Proxy to visit my site. From what I understand, everything should look he same until somebody goes through a Proxy.

goran424
04-28-2010, 10:44 PM
It doesn't cover Anonymizer, most popular IP proxy generator .....too bad.

martinmathews21
05-05-2010, 05:46 PM
What am i doing wrong?.
I installed it and made the mods to the file but as soon as i do everything appears blank.
I am running 4.0.2.

Paul M
05-05-2010, 06:15 PM
You must have made a mistake in your edit.

martinmathews21
05-06-2010, 02:46 AM
Thats what i thought to ...
I deleted all the original code and added what was in there.
As soon as i add it goes blank.
I did it twice.
I shouldnt need to modify my styles or anything ?.
I am just using the default vb4
So its supposed to be compatible with 4.0.2 i am just doing something wrong.

Paul M
05-06-2010, 10:01 AM
It works with any 4.0 version from 4.02 onwards.

No style edits are required.

Are you using a proper text editor, like notepad ?

Edit: Note you can also run it without the file edits, but it will only work for posts, not elsewhere on the forum.

KissOfDeath
05-06-2010, 10:23 AM
So if you banned an ip address then that same ip address came through on a proxy would it ban the person or just detect that they were using a proxy?

bflop
05-11-2010, 12:10 AM
I just installed this on 4.0.3 and it doesn't seem to be working. Will an updated version be available? Thanks.

Paul M
05-11-2010, 10:24 AM
This works fine on 4.0.3 so no, an update wont be available.

bflop
05-12-2010, 04:12 AM
My apologies Paul, apparently I was having a caching issue that prevented me from seeing the changes. I now see that all works well. Thank you for your work on this add-on.

martinmathews21
05-18-2010, 01:51 PM
I will give it another try.
I just used nano to edit it.

SuperTaz
06-26-2010, 09:37 PM
I altered the class_core.php file with your code, Paul, and I get a strange symbol at the top left corner of the site. Picture is attached.

When I install the default class_core.php file, it goes away.

SuperTaz
07-11-2010, 10:14 PM
Any word on this issue? ^^^

Paul M
07-12-2010, 12:54 PM
Only that its an issue with your editing of the file.

cloferba
07-30-2010, 09:57 PM
if a user is banned...and he try to enter to the forum using a proxy...will he be able to enter the forum or this mod will detect him and denied him the access to the forum?

Paul M
08-02-2010, 09:00 PM
No, this will not ban anyone.

cloferba
08-12-2010, 12:46 AM
no, im not speaking about this mod will bann a user...

i will say in other words what i want to say :) :
if i use this mod....
and a user access the forum through a proxy
will vbulletin see his real ip or his proxy ip?

and..if user is banned..if vb can see his real ip, he will not be able to see the forum

Paul M
08-12-2010, 08:22 PM
If the real ip is detectable then yes, its bannable.

dlindsey
08-16-2010, 12:06 PM
Works great for me...thanks!

sonixax
10-03-2010, 07:59 PM
is it work on vb 4.0.7 ?

pujabrang
10-29-2010, 10:07 PM
is this mod is compatible with vb 4.0.8

Paul M
10-30-2010, 09:01 AM
is it work on vb 4.0.7 ?

is this mod is compatible with vb 4.0.8
There is no need to keep asking this - unless you see something that says otherwise, it works on any 4.0.x

pujabrang
10-30-2010, 10:41 AM
sorry for offence mate

DAMINK
11-01-2010, 07:06 AM
I am assuming Step 1 has an misatke in the read me?
Read me contains below.


Step 1.

In class_core.php ;

Find ;

// fetch client IP address
$registry->ipaddress = $this->fetch_ip();
define('IPADDRESS', $registry->ipaddress);

// attempt to fetch IP address from behind proxies - useful, but don't rely on it...
$registry->alt_ip = $this->fetch_alt_ip();
define('ALT_IP', $registry->alt_ip);


Replace with ;

// Paul M - Get ip addresses.
$registry->ipaddress = $this->fetch_ip();
$registry->alt_ip = $this->fetch_alt_ip();

// Check that alt_ip is valid address, reset to original if not.
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $registry->alt_ip, $iplist))
{
$registry->alt_ip = $iplist[0];
}
else
{
$registry->alt_ip = $registry->ipaddress;
}

// Set ip constants.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->ipaddress);
}
else
{
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->alt_ip);
define('PROXYIP',$registry->ipaddress);
$registry->ipaddress = $registry->alt_ip;
}


Closing curly bracket is not supposed to be there? Well it errored for me unless i removed it.

Paul M
11-01-2010, 04:15 PM
There are no mistakes in it. All the curley brackets need to be there.

DAMINK
11-01-2010, 07:56 PM
There are no mistakes in it. All the curley brackets need to be there.

Interesting.
Then i will have to say this does not work.
I did exactly as above and my forum errored.
I removed the extra curly bracket and it was back up?
Dunno. Uninstalled until more is known about this i guess.

Paul M
11-01-2010, 11:31 PM
Then i will have to say this does not work.


If that were the case, this thread would be full of posts about a fault.

Im afraid I would say its down to a mistake being made by yourself.

mitch84
11-02-2010, 01:28 PM
installed and work fine on vb4.0.8, thank you!

OldSchoolDSL
11-24-2010, 09:40 PM
Installed 4.0.8

Not 100% sure if its working, but nothing is going wrong either so....

OldSchoolDSL
11-24-2010, 10:07 PM
Installed 4.0.8

Not 100% sure if its working, but nothing is going wrong either so....

Nope, didn't work. Uninstalled.

Was an odd issue. When clicking the link "Who's online" ... I would get almost a blank page (just the styles / themes background page)

4.0.8 SP2

Flying Gremlin
12-06-2010, 02:22 PM
Installed the 4.1.0 with the installation instructions in the included text file. After this, it broke the admin panel. All I get is this on the page where it used to be:



Had to upload the default class_core.php file in order to fix. Unfortunately, I am a relative novice when it comes to troubleshooting code, so I can't give you any additional insight.

Paul M
12-06-2010, 05:35 PM
The editor you are using is corrupting the file, you need to use a proper text editor (notepad would be fine).

Fungsten
12-06-2010, 09:24 PM
Can you update it without re-uploading the images?

Flying Gremlin
12-07-2010, 02:29 AM
The editor you are using is corrupting the file, you need to use a proper text editor (notepad would be fine).

Notepad is my text editor of choice and the only one I use.

SuperTaz
12-08-2010, 05:13 AM
Installed the 4.1.0 with the installation instructions in the included text file. After this, it broke the admin panel. All I get is this on the page where it used to be:



Had to upload the default class_core.php file in order to fix. Unfortunately, I am a relative novice when it comes to troubleshooting code, so I can't give you any additional insight.

I had the same issue with this mod that I posted here (https://vborg.vbsupport.ru/showpost.php?p=2060086&postcount=42) which eventually led to him giving me an answer that was not helpful on how to resolve it.

Vikingant
12-08-2010, 05:45 AM
If that were the case, this thread would be full of posts about a fault.

Im afraid I would say its down to a mistake being made by yourself.

I am getting the same probems. I crashed when I first tried. I tried again and the ACP worked fine but the rest of the site although still essentially functioning was all over the place.

I guess I am just not meant to use this mod :(


Edit to add: We are changing the file /includes/class_core.php right? Just making sure there isnat another instance somewhere I should be looking for. I did see one under /mgc_cb_evo/classes/class_core.php. Might that be upsetting it?

Paul M
12-08-2010, 10:21 AM
Can you update it without re-uploading the images?
Yes.

Paul M
12-08-2010, 10:32 AM
Notepad is my text editor of choice and the only one I use.
Then notepad is adding them. They are known as the Byte Order Mark (or BOM) and bacically get added to signal the file is utf-8 format. PHP cannot handle them. You need to either use an editor that doesnt add them, or find out how to edit/save files in notepad without it adding them.

Edit to add: We are changing the file /includes/class_core.php right? Just making sure there isnat another instance somewhere I should be looking for. I did see one under /mgc_cb_evo/classes/class_core.php. Might that be upsetting it?
You are changing the correct file, no idea what the other file is, looks like some kind of modification supplied file.

Vikingant
12-08-2010, 08:50 PM
mgc_cb_evo is a shout box i once had installed but never removed the file. I have now removed it and things improved somewhat but still get the 'raw' pages here and there. Have had to uninstall completely. Great concept tho.

OldSchoolDSL
12-12-2010, 07:37 AM
Nope, didn't work. Uninstalled.

Was an odd issue. When clicking the link "Who's online" ... I would get almost a blank page (just the styles / themes background page)

4.0.8 SP2

INSTALLED

You're update seems to have corrected this error (odd little bug). :up:

Not sure if its working yet as I've yet to see anyone with a proxy

Sforums
01-07-2011, 03:44 PM
Tried on 4.0.1 PL2 and got this error:

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:1) in [path]/includes/functions.php on line 3879

Paul M
01-07-2011, 10:04 PM
I think you mean 4.1.0 PL2.

The error means you broke the edited file, I would guess you used an editor that corrupted the file by adding the UTF marker at the start of it (see post #68).

Sforums
01-09-2011, 10:10 AM
I think you mean 4.1.0 PL2.

The error means you broke the edited file, I would guess you used an editor that corrupted the file by adding the UTF marker at the start of it (see post #68).

Yes, 4.1.0 PL2.

I tried again and got even more severe error. This is how my modifyed class_core.php looks like (attachment)

Where did I go wrong?

Paul M
01-09-2011, 10:35 AM
Ive removed the attachment as you are not permitted to upload entire vb files.

Your issue is exactly what I said - your editor has added the BOM bytes at the start of the file.

/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.1.0 Patch Level 2 - Licence Number VBF1EE61F6
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/

Sforums
01-10-2011, 08:49 AM
Thanks Paul, it works now.

DAMINK
01-11-2011, 04:23 AM
Registration denied, this forum runs an active policy of not allowing spammers. Please contact us via the "Contact Us" page link if you believe this is in error

Does this error relate to this plugin?
Seems no one can register to my forum now.
Even after uninstalling and deleting the mod??

Sforums
01-11-2011, 10:39 AM
Sorry, but I have to get rid of this thing.....Every time someone using proxy enters my site it creates havoc. Receiving over 100 email messages such as this daily:

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections

public_html/includes/class_core.php on line 312

Paul M
01-11-2011, 10:54 AM
Does this error relate to this plugin?
Nope.

Seems no one can register to my forum now.
Even after uninstalling and deleting the mod??
Well since that issue has nothing to do with this mod, thats not really surprising. :)

Sorry, but I have to get rid of this thing.....Every time someone using proxy enters my site it creates havoc. Receiving over 100 email messages such as this daily:

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections

public_html/includes/class_core.php on line 312
Nothing to do with this Im afraid. Your issue lies elsewhere.

Bacon Butty
02-12-2011, 02:18 PM
This scrambled my forum.

Disabled hooks, went in and uninstalled and it was fine again.

Shame, looked a useful mod.

Paul M
02-12-2011, 02:40 PM
This cannot "scramble" anything (whatever that even means).

Fready
02-12-2011, 03:11 PM
For anyone reading, Paul M's mods never have problems.
They are the cleanest mods on vb.org.

You just install and they work, end of.

Keep up the good work Paul, and get making some new mods.

Bacon Butty
02-12-2011, 08:17 PM
This cannot "scramble" anything (whatever that even means).

For anyone reading, Paul M's mods never have problems.
They are the cleanest mods on vb.org.

You just install and they work, end of.

Keep up the good work Paul, and get making some new mods.

It didn't on my forum (http://www.grandoldteam.com/forum/).

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:1) in [path]/includes/functions.php on line 3808

It was definitely an issue with this modification because normal service was resumed the second I uninstalled it.

Shame, because it was a very useful mod for me on 3.8.

Paul M
02-12-2011, 09:34 PM
It was definitely an issue with this modification because normal service was resumed the second I uninstalled it.
Nope, its an issue with whatever you used to edit the file. Read posts #71, #72 and #74 (previous page).

Bacon Butty
02-13-2011, 11:45 AM
Nope, its an issue with whatever you used to edit the file. Read posts #71, #72 and #74 (previous page).

Noticed that - I used notepad.

I attempted a fresh install 3 times. Twice with notepad, once with phpeditor.

It seemed to conflict with something? If you check out my website you'll see I'm not a novice who can't perform one simple template edit. Fully customised and synced CMS....

Anyway - I've used your mods for a while and intend to use a few more of them. Keep up the good work.

Paul M
02-13-2011, 01:00 PM
It seemed to conflict with something?
Nothing is conflicting, you are corrupting the first line of class_core.php as your error clearly shows you.

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:1) in [path]/includes/functions.php on line 3808

OldSchoolDSL
02-13-2011, 02:14 PM
I kind of wish Internet Brands would pay Paul M for this modification and make it standard in every release. I say kind of, because I'm sure they'd mess it up.

djbaxter
02-13-2011, 02:54 PM
Registration denied, this forum runs an active policy of not allowing spammers. Please contact us via the "Contact Us" page link if you believe this is in error

Does this error relate to this plugin?
Seems no one can register to my forum now.
Even after uninstalling and deleting the mod??

Your error is from the vbStopForumSpam mod.

Bacon Butty
02-13-2011, 05:49 PM
Nothing is conflicting, you are corrupting the first line of class_core.php as your error clearly shows you.

That was one of several errors. Will dig rest up and post later.

[Edit] In fact, given the pedantic nature of your replies, I'd rather not waste any time. I'll leave that to someone else to work out what it conflicts with.

Paul M
02-13-2011, 06:33 PM
That was one of several errors. Will dig rest up and post later.

[Edit] In fact, given the pedantic nature of your replies, I'd rather not waste any time. I'll leave that to someone else to work out what it conflicts with.
Suit yourself. If you cant accept the facts when pointed out, your problem, not mine.

Bacon Butty
02-13-2011, 06:48 PM
Facts?

Well, this mod broke my forum (http://www.grandoldteam.com). When I install it, the forum breaks. When I uninstall it, it works. It's that simple.

Untick 'Supported' and replace with "Arsy, pedantic & rather than try and get to the bottom of the issue, will actively place blame on anything other than mod";

You must have made a mistake in your edit.

I just installed this on 4.0.3 and it doesn't seem to be working. Will an updated version be available? Thanks.

This works fine on 4.0.3 so no, an update wont be available.

Any word on this issue? ^^^

Only that its an issue with your editing of the file.

Interesting.
Then i will have to say this does not work.
I did exactly as above and my forum errored.
I removed the extra curly bracket and it was back up?
Dunno. Uninstalled until more is known about this i guess.

If that were the case, this thread would be full of posts about a fault.

Im afraid I would say its down to a mistake being made by yourself.

The editor you are using is corrupting the file, you need to use a proper text editor (notepad would be fine).

I am getting the same probems. I crashed when I first tried. I tried again and the ACP worked fine but the rest of the site although still essentially functioning was all over the place.

I guess I am just not meant to use this mod :(


Edit to add: We are changing the file /includes/class_core.php right? Just making sure there isnat another instance somewhere I should be looking for. I did see one under /mgc_cb_evo/classes/class_core.php. Might that be upsetting it?

Listen to feedback, stop being so defensive, consider for a moment it's not the ineptness of the person performing the simple file edit and get of the pedestal.x

Paul M
02-13-2011, 07:40 PM
Facts?
Yes, Facts.

stop being so defensive
People (including you) screw up the edit, mostly its not their fault, its their editor thats at fault. Most people accept this, fix it, and all is ok. You decide to be argumentative and try to make out its the fault of the mod. If pointing out you are wrong is being "defensive" then so be it.

consider for a moment it's not the ineptness of the person performing the simple file edit and get of the pedestal
I dont need to consider it, after 6+ years I know the reason is a bad edit. It isnt the mod, if it were id know [and fix it] - the FACT is that if you do it all correctly, it works every time. Simple as that. Hell, it'll even work for posts [only] without the edit. I suggest you stop making foolish claims.

onehost
02-13-2011, 11:17 PM
I have been having the same class core errors everyone else is having.
I have tried 3 different editors with zero success. looks nice if it worked,
but I just do not have time to nurse this by having to look for a special editor....

Paul M
02-13-2011, 11:34 PM
I have been having the same class core errors everyone else is having.
I have tried 3 different editors with zero success. looks nice if it worked,
but I just do not have time to nurse this by having to look for a special editor....
Im starting to get somewhat tired of people making false posts, so Im just going to remove them in future.

For the last time, it works fine and "everyone else" is not having an issue, just those who use an editor that breaks the file (something that seems to be more common in recent times, no doubt due to more modern text editors adding the BOM by default). If you dont want to spend time finding one that works then thats fine, your choice, but dont go making false accusations about other peoples work.

onehost
02-14-2011, 12:06 AM
Im starting to get somewhat tired of people making false posts, so Im just going to remove them in future.

For the last time, it works fine and "everyone else" is not having an issue, just those who use an editor that breaks the file (something that seems to be more common in recent times, no doubt due to more modern text editors adding the BOM by default). If you dont want to spend time finding one that works then thats fine, your choice, but dont go making false accusations about other peoples work.

I guess you can take it how you like. There is nothing false about what I
said, and at no point did I ever accuse your mod being the problem. I explained
how I tried to solve the issue by using 3 editors, did not work...I am not
blaming your mod, and i actually understand what you are saying about
how the error is produced by saving the file, and the save produced not
so desirable results...but my attempts to cure the problem by using 3
different editors have failed, and I have to move on...

and to be honest, I would just rather ban the proxies, then convert them...
other then from govt/school/work, etc...the only legit reason for a proxy is to hide...
or to bypass so that you can hide yourself either way....I just can not think of any
legit reasons why proxies should even exist...

I have two members on my forum that seem to appear on the forum at almost the
same time together...and guess why, they hide behind proxies, why? I know for
a fact that one of them is a spammer...he is scared to post because he knows
I will kick him off...I am still not so sure why he even hangs around....those
two members do not contribute anything to the forum at all....but they
keep logging on and doing nothing....There is mostly one reason for a
proxy, and most of the time it does not turn out to be a very good reason.

once again, i am not blaming your mod....

OldSchoolDSL
02-14-2011, 12:20 AM
I personally use NotePad++ (its freeware and small) to edit any and all my PHP files.
http://notepad-plus-plus.org

I would think that if you still have a problem with this modification AFTER using NotePad++ ... Either you copy & pasted the code incorrectly or there is an outside conflict with something you already have installed.

Paul M's modification seems to work with the majority of those who apply it and as suggested... It could be your editor.

Try using NotePad++ to not only edit the file, but to copy & past from the directions.

onehost
02-14-2011, 12:39 AM
I personally use NotePad++ (its freeware and small) to edit any and all my PHP files.
http://notepad-plus-plus.org

I would think that if you still have a problem with this modification AFTER using NotePad++ ... Either you copy & pasted the code incorrectly or there is an outside conflict with something you already have installed.

Paul M's modification seems to work with the majority of those who apply it and as suggested... It could be your editor.

Try using NotePad++ to not only edit the file, but to copy & past from the directions.

Thanks

Ill give it a whirl when I have more free time.

Bacon Butty
02-14-2011, 03:57 PM
I personally use NotePad++ (its freeware and small) to edit any and all my PHP files.
http://notepad-plus-plus.org

I would think that if you still have a problem with this modification AFTER using NotePad++ ... Either you copy & pasted the code incorrectly or there is an outside conflict with something you already have installed.

Paul M's modification seems to work with the majority of those who apply it and as suggested... It could be your editor.

Try using NotePad++ to not only edit the file, but to copy & past from the directions.

Thanks mate - I use NotePad myself. It's a very simple edit, one I repeated numerous times on a fresh file with two different editors (notepad and phpeditor) to check I wasn't losing the plot. It didn't work & it wasn't the edit or the editor. Odd. But thanks for the suggestion, it may come in handy for someone.

OldSchoolDSL
03-05-2011, 07:47 PM
For those of us who do simply copy & paste code... I did notice a small type error (if you want to call it that).

For example

;

Should not end with a space at the end of it.

If you are simply coping and pasting, please be sure to remove the little space (think I found 2) at the end of the code.

I'm not sure if I've done a good example of explaining this.

I think Paul M has done a wonderful job at developing this modification.

Tested and working

4.1.2

Paul M
03-05-2011, 09:41 PM
Should not end with a space at the end of it.


Why ?


If you are simply coping and pasting, please be sure to remove the little space (think I found 2) at the end of the code.

There really is no reason to do this - PHP doesnt care about spaces (or tabs). :)

OldSchoolDSL
03-05-2011, 10:57 PM
Why ?



There really is no reason to do this - PHP doesnt care about spaces (or tabs). :)

That has not been my own experience. But I could be explaining it wrong.

MrsTryst
03-06-2011, 03:52 PM
hello,
first of all GREAT mod.
But when i change the class_core.php my DragonByte-Tech shoutbox get messed up.. would appreciate the help.

Thanks

Paul M
03-06-2011, 07:12 PM
I think you need to ask DragonByte about that - I dont see how the two could be related, but I dont have it.

australiaforum
03-09-2011, 04:37 AM
I had the same problem as with a couple of other people with the funny characters in the file, when using notepad. Using notepad++ everything worked as documented.

Sarteck
05-22-2011, 09:37 PM
Paul,

I recently uninstalled this product from my forum, just because I was doing a cleanup of old modifications we don't use anymore. Afterwards, I was getting a database error whenever someone was trying to create a post. The database error said that it had Invalid SQL: "Unknown column 'proxyip' in 'field list'".

Looking through your uninstall code, I do see that there is code to drop this field from the database:
$db_alter->drop_field('proxyip')

However, I would think that dropping the field would be okay, wouldn't it? Do I have something else still trying to insert data into the now-non-existing proxyip field? It's not a vB default field, is it?

For now, as a quick fix, I've just re-added the field to the post table, and everything is back to working as normal. Would like to hear from you, though, if there's something I did wrong, and something I have to fix. X3

Thanks.

Paul M
05-22-2011, 10:12 PM
That would suggest you still have a plugin related to this installed (an old version ?).

Sarteck
05-22-2011, 11:24 PM
That's what I was thinking, too, but doing a search in my plugins (WHERE phpcode LIKE "%proxyip%") yielded nothing. All my default files were over-written with my recent upgrade to 4.1.3, too, so I know it's not edits to any vB original files... So I guess all that's left is other files that might be "included" by some plugin?

a quick grep -rl "proxyip" * in my web root doesn't reveal any answers, though. :<

Paul M
05-23-2011, 12:53 AM
Well something is lingering somewhere, it can only be a plugin, the mod has/had no files.

Sforums
05-23-2011, 10:19 AM
Question for Paul:

modification works fine but it shows my real IP to moderators.
How to go around this?

Paul M
05-23-2011, 10:28 AM
You dont get around it, thats its purpose. :D

JohnGR
05-23-2011, 10:34 AM
Question for Paul:

modification works fine but it shows my real IP to moderators.
How to go around this?

dont allow moderators to see ip permission :D

Sforums
05-23-2011, 10:35 AM
Yes, for admin to see. Btw, I am an admin, like to keep my IP private.

JohnGR
05-24-2011, 09:48 PM
Hello Paul,

that version work on 4.13 ?

Thx

Paul M
05-25-2011, 07:26 AM
Yes.

ironlung
06-27-2011, 05:33 PM
will this work on vB4.1.4? I installed it but not so sure if its working. I edited class_core.php accordingly and installed the xml, but I see the regular ip icon (not the red one included with this mod) and just shows the regular response for someones ip

Paul M
06-27-2011, 08:31 PM
Yes, this works on 4.1.4

SoltanWorld
07-15-2011, 07:18 AM
@Paul:
I've installed this mod but it doesn't show the proxy ip address of users which are using proxy.
Vb 4.1.3
any idea?

Paul M
07-15-2011, 11:07 AM
I presume you have read the first post ?

Note: This hack relies on the proxy server passing the correct http variables to allow detection. If they are not passed then detection will not work. By definition, annonymous proxies do not pass on these variables.

@ngel
07-16-2011, 02:05 PM
Great! I'm trying it now with cloudflare! Thanx!

Zabulus
07-27-2011, 08:15 PM
Question: It doesn't CHANGE anything for the user, it is just for informational purposes for me correct?

It shows which users are using a proxy?

HMBeaty
07-27-2011, 08:17 PM
Question: It doesn't CHANGE anything for the user, it is just for informational purposes for me correct?

It shows which users are using a proxy?
Correct

nchoate97
08-10-2011, 01:43 AM
Please get it for vBulletin 4.1.5!!!!!!!

Paul M
08-10-2011, 11:18 AM
Not exactly sure what you mean, this is for any 4.1.x version.

dai-kun
10-12-2011, 02:00 AM
There's some changes in 4.1.7 that I can't make the file edit to class_core.php.

Are there new instructions?

Audiofanzine
10-12-2011, 08:57 AM
So does that mean that troll members whose real ip was banned and register under proxy ips will not be allowed in? Cause this is my problem now...

Paul M
10-12-2011, 11:32 AM
There's some changes in 4.1.7 that I can't make the file edit to class_core.php.

Are there new instructions?
No, not at the moment. There will be some more changes to this in 4.1.8.

Paul M
10-16-2011, 12:22 PM
Updated: This is now available for the 4.1.x series of vBulletin only.

fly
10-16-2011, 01:13 PM
Not a big deal, but to avoid confusion you have the date wrong of the last update in your first post
v4.1.7.0 : 16-Oct-2010 : Updated for vBulletin 4.1.7.

Paul M
10-16-2011, 06:03 PM
*sigh* thats what you get when you copy / paste. Thanks.

misericorde
10-16-2011, 09:13 PM
Thank you very much for Uptaded vb 4.1.7

Very nice

Bye

OldSchoolDSL
11-18-2011, 12:43 AM
I was very happy to see this no longer needed the file edit :)

Installed and "believed to be" working in 4.1.8

Paul M
11-18-2011, 10:12 AM
The file edits are needed on 4.1.8 - the changes only exist in 4.1.7, they were reverted in 418.

OldSchoolDSL
11-18-2011, 07:49 PM
The file edits are needed on 4.1.8 - the changes only exist in 4.1.7, they were reverted in 418.

Oh well :(

Thanks for the heads up though :up:

OldSchoolDSL
11-19-2011, 01:15 AM
In today's update.... Just the note added in the read me about 4.1.8 or code as well?

Paul M
11-19-2011, 01:46 PM
Yes.

OldSchoolDSL
11-19-2011, 04:06 PM
Yes.

LOL:p

Aitorcillo
11-20-2011, 10:18 AM
Paul M, could i install this mod in my vbulletin 4.1.4 version? Or just to 4.1.8

thank you

Paul M
11-20-2011, 11:57 AM
As it says, any 4.1.x

ZemantiX
11-21-2011, 09:56 PM
Hi Paul, I did as instructed and did a overwrite of the 4.1.7 version, and my admincp went to white and showed only this "" (Firefox). I managed to enter admincp with IE and uninstalled the mod again, after that I could access through Firefox again. I double checked everything and did a fresh new install but the same happened.

Any idea what causes this?

ZemantiX
11-21-2011, 11:00 PM
Update: I found that I had saved the class_core.php in UTF-8 format the first time around so I saved it in ANSI instead, that helped but I still can't get the mod to work. I don't find any proxy IPs in the forums and there's no red IP button to be seen either. :s

kizy
11-27-2011, 11:32 AM
I followed your instruction step by step, replaced the needs in includes/class_core.php (copy&paste), and upload the ip-40x.png under buttons folder and imported the product...

then, I using a test user + ultrasurf posted somes threads..., but the IP doesnt turn red :)

my is vb4.1.8

Thank you.

Paul M
11-27-2011, 03:07 PM
I take it you read the note :)

Note: This hack relies on the proxy server passing the correct http variables to allow detection. If they are not passed then detection will not work. By definition, annonymous proxies do not pass on these variables.

Taurus1
12-11-2011, 05:55 AM
Hi Paul, great mod, thank you.

One question please. Do I have to upload the image in all my custom themes buttons folder, or just the default folder?

Thanks.

Paul M
12-11-2011, 11:36 AM
You will need to upload it to individual themes.

EuroDisco
12-11-2011, 11:53 AM
This product is not working in 4.1.8

trainer
01-17-2012, 04:34 PM
does this work for latest version?

Paul M
01-17-2012, 10:47 PM
It works for all 4.1.x

Mukashi
01-18-2012, 01:58 PM
The file edits are needed on 4.1.8 - the changes only exist in 4.1.7, they were reverted in 418.

Out of interest....do you know why that happened? It doesn't seem to make a lot of sense.
Honestly, I'm surprised this functionality isn't already included in the base vB package, now that you're doing part-time work for them.

Fudgyyy
02-20-2012, 10:42 PM
How do I find class_core.php to make the changes?

Edit: Nevermind I found it.

Fudgyyy
02-21-2012, 11:00 PM
I don't see a red ip icon when someone is under a proxy, and also the only two things that i see when I click on an ip is the actual ip, and the ip lisiting.

Mr GRiM
03-14-2012, 02:11 PM
Thanks this looks like something pretty useful, things like this should be built into VB I think.

javaidvip
03-23-2012, 03:15 PM
dear not working 4.1.11
any soulations?

New Joe
03-23-2012, 04:10 PM
dear not working 4.1.11
any soulations?

With a post like that you won't get much help.
Post the reasons why it's not working, what doesn't work.

imported_ahw
05-03-2012, 04:44 PM
i'm using 4.1.12 it works perfectly

Hendrizius
05-09-2012, 10:33 PM
Keep up the good work. Excellent mod!

Works perfect with Hproxy + Nginx + Apache

huskermax
05-14-2012, 01:47 AM
Parse error: syntax error, unexpected '<' in /home/huskerma/public_html/vbbs/includes/class_core.php on line 2042

This is what I get? Use 4.1.12 patch 1

Made the change in class core.php Uploaded the xml file and image. And Each time I upload the changed class core file I get the above error.

ForceHSS
05-24-2012, 08:01 PM
Parse error: syntax error, unexpected '<' in /home/huskerma/public_html/vbbs/includes/class_core.php on line 2042

This is what I get? Use 4.1.12 patch 1

Made the change in class core.php Uploaded the xml file and image. And Each time I upload the changed class core file I get the above error.

Why did you edit the class core file for have you tried putting it back to default. It looks like you made an error when you edited it

gremrock
05-26-2012, 09:57 AM
Thanks for the update, it's installed and will mark it as recommended to anyone!

Chadi
05-26-2012, 08:10 PM
Strange, I modified core file and uploaded plugin, but the button is not showing up. I see a minimal hyperlinked _ which works if I click it.

I checked page source, ip-40x doesn't even show up at all in page source. I have the button uploaded to images/buttons and even my custom style at images/element/buttons as well.

Dave-ahfb
06-13-2012, 04:40 PM
using 4200.zip on my 4.2, the changes to class_core give me an unable to add cookies header already sent error.

Crotan
07-02-2012, 10:27 PM
what proxy can I test with to see if this is working, I used http://anonymouse.org/ but I still get the proxy IP and not the real IP.

So the question is which proxies pass the correct http variables to allow detection?

Komandar
08-03-2012, 12:46 PM
The old method from version 4.0.8 of this plugin works.
The new one not.

Paul M
08-03-2012, 03:50 PM
There is no "old" and "new" method :confused:

tourajabbasi
08-13-2012, 01:55 PM
doesnt work on 4.2 pl2 .... i dont even get an option for it...

fly
08-13-2012, 03:49 PM
doesnt work on 4.2 pl2 .... i dont even get an option for it...

You're likely doing something wrong, as Paul stays pretty on top of this stuff. What do you mean that you don't get an option?

doctorsexy
08-17-2012, 09:27 AM
Hi .. will this make vbulletin 4.2 pl2 show the correct ip in whos online with cloudflare

doctorsexy
08-17-2012, 10:11 AM
Just tryed it and for some reason it dosnt change anything, still have the wrong ips .. can anyone help..thanks

Paul M
08-18-2012, 12:45 AM
It should detect cloudfare - did you do the file edits correctly ?

doctorsexy
08-18-2012, 08:23 AM
yes..all file edits to class_core.php done as the instructions ,but still had cloudfare ips in whos online ect

doctorsexy
08-18-2012, 12:23 PM
Trying it again now...looks good... thanks

crashys
08-18-2012, 08:25 PM
Not working for me with Cloudfare.

Using VB 4.2.0 PL2.

Changed class_core.php according to instruction, installed the product but the hostnames of people logged remain pointing to couldfare.

doctorsexy
08-19-2012, 07:58 AM
Turned cloudflare off. it was sending alot of spammers

http://i441.photobucket.com/albums/qq131/doctorsexy007/Capture3.png

it was showing this . then it went back to all showing cloudflares ips. so dont know if it works or not...

fasters
09-05-2012, 02:28 AM
Not working for me.
I have follow the instruction, but nothing change.
what should I do?

Paul M
09-07-2012, 11:19 AM
You could start by explaining what you mean by "but nothing change".

What didnt change that you were expecting ?

jpierce
09-16-2012, 12:14 PM
I installed as directed, including the edits to class_core but I still only see the Cloudflare IPs.

What steps can I take to debug the issue?

Thanks!

John

jpierce
09-16-2012, 12:34 PM
I seemed to have fixed it by installing mod_cloudflare on the server.

jasff
09-28-2012, 02:24 AM
Hey gang, I am a brand new VB forum owner. I have a new site. Although new, I have been a VB moderator for several years, with some Admin access. I'm on a crash course of learning. Have completed a lot of tasks.

I am very interested in this mod. I've never done a mod before and wanted to know how easy this is? I know instructions are attached in the download. Just curious what level of difficulty this mod is?

Thanks in advance.

Paul M
09-28-2012, 12:48 PM
Its quite simple, one product to install, one (optional) file edit.

MG Zebra
10-01-2012, 05:20 AM
Not sure if you've included this information in the other versions of this modification but it would be greatly appreciated if you included where the class_core.php file was for future reference instead of having people need to search through 5 pages of comments until someone has asked about it. I'm referring to version 4200. I'm new to the vb file system so I had no clue where it was at. I'll be installing this to see if it works for me.

mat8861
10-18-2012, 03:24 PM
Imported the product, installed the icon Did the mod to /includes/class_core.php:

// set debug mode
$this->debug = !empty($this->config['Misc']['debug']);
define('DEBUG', $this->debug);

$proxy = false;
if (isset($this->config['Misc']['proxyiplist']))
{
$proxylist = array_map('trim', explode(',', $this->config['Misc']['proxyiplist']));

if (in_array($this->ipaddress, $proxylist))
{
$proxy = true;
if (isset($this->config['Misc']['proxyipheader'])
AND isset($_SERVER[$this->config['Misc']['proxyipheader']]))
{
$altip = $_SERVER[$this->config['Misc']['proxyipheader']];
if ($this->input->filter_ip($altip))
{
$this->alt_ip = $altip;
}
}
}
}
// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $this->alt_ip);
}
else
{
define('IPADDRESS', $this->ipaddress);
define('ALT_IP', $this->alt_ip);
}

define('SESSION_HOST', substr(IPADDRESS, 0, 15));
}

/**
* Takes the contents of an array and recursively uses each title/data
* pair to create a new defined constant.
*/

Tried to login thru couple anonimous proxy ips (61.135.209.203:81 and 89.248.168.139:8080)...no "red" ip

https://vborg.vbsupport.ru/external/2012/10/25.jpg

Paul M
10-18-2012, 08:55 PM
Tried to login thru couple anonimous proxy ips (61.135.209.203:81 and 89.248.168.139:8080)...no "red" ip



As it says (in bold) in the first post ;
Note: This hack relies on the proxy server passing the correct http variables to allow detection. If they are not passed then detection will not work.
By definition, annonymous proxies do not pass on these variables.

mat8861
10-19-2012, 01:28 PM
would you please post (or pm) an ip that I can test to make sure your mod is working? Is "TOR" network detected ? Thanks for your nice mods !

Cybex
11-17-2012, 11:22 AM
Dear Paul M,

Today I installed Google's PageSpeed Service (not mod_pagespeed) which is an CDN just like CloudFlare. According to this FAQ the service is sending real IP headers: https://developers.google.com/speed/docs/pss/faq#clientip.

I edited the class_core.php file correctly and installed the mod. When I create a new post on my forum, it still shows the IP address of Google's Proxy servers. How can I troubleshoot this?

The IP Address is: 74.125.17.223
The host name is: 74.125.17.223

I am using vBulletin 4.2 patch level 2. My forum is located at http://www.osx86.net.

Cybex
11-17-2012, 11:53 AM
We fixed it ourselves by editing the class_core.php bit:

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
else
{
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
define('ALT_IP', $this->alt_ip);
}

Now the proxy details aren't written properly, but that's not that important for me. At least I see the real IP addresses now.

hsoen
12-15-2012, 05:52 AM
Seem like it does not work.

vBulletin Message only show:

The IP Address is:
The host name is:

Which is not the same as shown in the screen shot attachment of this mod.

The Real IP Address is:
The Real IP Host is:
The Proxy Server IP Address is:
The Proxy Host is:

Any advise? Thanks.

togotutor
12-26-2012, 01:32 AM
Let me give it a try..

Quijar Haderak
01-24-2013, 12:08 AM
We fixed it ourselves by editing the class_core.php bit:

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
else
{
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
define('ALT_IP', $this->alt_ip);
}

Now the proxy details aren't written properly, but that's not that important for me. At least I see the real IP addresses now.

Thank for this, i hope Paul M fix it in next release or anyone make a mod for working only vBulletin + Google Pagespeed Service...

temsamane
02-15-2013, 11:06 PM
i am using google pagespeed service, and the fix of cybex is not working for me. Is there another solution?

GamerPerfection
02-28-2013, 12:12 PM
I am going to try this and do what Cybex said because I started using Google PageSpeed a few days ago and only just realised that everyone is coming from the same or similar Google IPs and therefore the StopForumSpam Mod is going to let everything through registration based on IP address.

Hopefully this will fix that otherwise i'll have to scrap PageSpeed.

GamerPerfection
03-01-2013, 11:48 AM
Cybex's fix seemed to fix the PageSpeed issue.

iraqiboy90
03-04-2013, 08:53 PM
this solution by cyber may be working partially, but its not worth it, because:

.htaccess does still recognize the proxy IP, and cant ban the real IP
IPs not written properly which makes it less user-friendly to resolve the IP
some IPs are extremely not written properly. example: 2620:0:1004:2:d

vivapotenza
03-28-2013, 06:24 PM
quick question Paul, im unsure if I've got this working ok.

If this is installed ok (ive edited the core file, and installed it successfully), should i see 4 options instead of 2 when I click to see someones IP address? At the minute I still only see 2, but my understanding is i should now see 4, but two will be blank if the IP address is not transmitted through the proxy?

Paul M
03-29-2013, 01:53 AM
No, you will only see four if a proxy was used and detected.

bbmisc
03-29-2013, 06:59 PM
hey installed this for 4.2 and followed the instructions correctly i believe, however iam still only getting Cloudflare post IP's and not the real Ip's. any ideas? thank you

toon79
04-10-2013, 12:23 PM
Tried installing this to fix my issue here: https://vborg.vbsupport.ru/showthread.php?p=2415510

When I view the people online they are all still sharing the Google IP address. Could I have done something wrong?

bfdzio
04-11-2013, 12:56 AM
Seconding on the Google Pagespeed thing.

I installed Pagespeed yesterday, today a ton of people getting logged out. I have installed this and applied the fix above....but I still only see google IP's.

edit: looks like it worked...just had not heard from members. My logins log started showing different IP's right when I uploaded the updated class_core.php, but the IP button still shows the google. No big deal.

smirkley
04-11-2013, 02:51 AM
Paul,... I have this installed.

Question is, does this work for tor connections?

I have a member that has shown it not to detect tor connections as proxy at all.

Maybe because of the mechanism used. I dunno.

muimui
04-11-2013, 06:09 AM
paul,i use china proxy.but real ip not detect.its still work at 4.2?

toon79
04-11-2013, 06:45 AM
Seconding on the Google Pagespeed thing.

I installed Pagespeed yesterday, today a ton of people getting logged out. I have installed this and applied the fix above....but I still only see google IP's.


edit: looks like it worked...just had not heard from members. My logins log started showing different IP's right when I uploaded the updated class_core.php, but the IP button still shows the google. No big deal.

How did you get this to work? I can't even see the IP button on my forum?

toon79
04-11-2013, 07:23 AM
We fixed it ourselves by editing the class_core.php bit:

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
else
{
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
define('ALT_IP', $this->alt_ip);
}

Now the proxy details aren't written properly, but that's not that important for me. At least I see the real IP addresses now.

Think this has worked for me. Thanks

final kaoss
04-16-2013, 03:31 PM
Here Paul, I helped you with your image a bit. From 133 to 119 bytes.

Other than that thanks for the mod, I'm trying it right now as I'm using google PSS and it is referring all of google's proxys instead of the true members ip addresses.

toon79
04-17-2013, 07:33 AM
Here Paul, I helped you with your image a bit. From 133 to 119 bytes.

Other than that thanks for the mod, I'm trying it right now as I'm using google PSS and it is referring all of google's proxys instead of the true members ip addresses.

I got it working with the above

final kaoss
04-17-2013, 11:54 AM
Yeah it resolved my issue as well after the who's online list had time to filter out all of the old guests.

toon79
04-17-2013, 12:42 PM
Yeah it resolved my issue as well after the who's online list had time to filter out all of the old guests.

Glad to hear that, I had a nightmare finding a fix

elfenny
04-25-2013, 07:05 PM
then on at work?

bbmisc
04-26-2013, 12:14 PM
ok i got new posts to show the real IP not cloudflare IP, is there anyway to reset OLD post/registration IP's to their real IP's and not cloudflare IP?? thank you

xXSiCkXx
05-01-2013, 10:54 AM
Will this work with cloudflare ?

Paul M
05-01-2013, 03:32 PM
I believe it does.

M.Rizk
05-07-2013, 04:45 AM
I have vBulletin 4.2.1, I installed this plugin about 4 days ago. It only worked for a day but not anymore. Now the Host (A2 Host) IP appears again as I am using their Integrated CloudFlare and Railgun service.

iraqiboy90
05-13-2013, 07:27 AM
Hello paul

Can you please take a look into cybers' fix?
I really want to use a CDN like pagespeed, but cybers' fix makes me get some wierd IP output for the system to recognize.

Regards
iraqiboy90

0verl0rd
06-17-2013, 04:42 PM
It doesn't work with cloudflare.. :( helpppp

fly
06-17-2013, 05:25 PM
It doesn't work with cloudflare.. :( helpppp

https://www.google.com/search?q=cloudflare+vbulletin

Second link.

0verl0rd
06-18-2013, 02:01 PM
yeah i have seen that link already...

i also opened a ticket to cloudflare... and they are giving me those 2 options...

I already installed this add-on and the option 2 is somehow difficult because of the construction of code...



How to do this:


Find: function fetch_ip() { return $_SERVER['REMOTE_ADDR']; }

replace with:

function fetch_ip() { if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { return $_SERVER['HTTP_CF_CONNECTING_IP']; } return $_SERVER['REMOTE_ADDR']; }



with these:


/**
* Fetches the IP address of the current visitor
*
* @return string
*/
function fetch_ip()
{
return $_SERVER['REMOTE_ADDR'];
}

/**
* 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_X_FORWARDED_FOR']))
{
$altip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if (isset($_SERVER['HTTP_CLIENT_IP']))
{
$altip = $_SERVER['HTTP_CLIENT_IP'];
}
else if (isset($_SERVER['HTTP_FROM']))
{
$altip = $_SERVER['HTTP_FROM'];
}
else
{
$altip = false;
}

if ($altip AND $this->filter_ip($altip))
{
$alt_ip = $altip;
}

return $alt_ip;
}

Bubble #5
08-13-2013, 11:49 PM
THANK YOU for this excellent hack Paul!

boggseric
08-16-2013, 12:33 AM
Paul, thanks for the hacks!

Question, I am upgrading my 3.8 forum to 4.2. the forum has quite a few posts (15mil) and modifying the post table on the uninstall of the old mod and then the install of the new version is quite a headache and server intensive.

I was looking at the code and it appears to me the only difference is that the old proxyip field was varchar(20) whereas the new one calls for varchar(15). I'm guessing modifying the product code to not drop this column wouldn't cause a problem right? Those extra 5 characters shouldn't be an issue in my opinion but my database skills are not super high.

So basically before uninstalling the old mod change the code to not drop the column and then modify the new plugin xml to not add the column. Note, I'm not asking for instruction of how to do that I can handle that part, just curious if you think this will break anything or cause problems.

Paul M
08-17-2013, 07:49 PM
That sounds fine to me.

However - if you just install the new one, without uninstalling the old one, the new one will remove the old product without running the uninstall code anyway.

Same effect, less effort. :)

Bubble #5
08-17-2013, 09:25 PM
Paul, how do we nominate this modification for the MOTM? I saw no link or directions...:confused:

djbaxter
08-17-2013, 11:32 PM
Paul, how do we nominate this modification for the MOTM? I saw no link or directions...:confused:

It's currently in the running for the Mod of the Month so all you need to do is go vote for it: https://vborg.vbsupport.ru/portal.php or https://vborg.vbsupport.ru/showthread.php?t=300696

Paul M
08-18-2013, 02:30 PM
LOL, so it is. I never noticed that. :)

Disco_Dave
08-19-2013, 10:23 AM
We fixed it ourselves by editing the class_core.php bit:

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
else
{
define('IPADDRESS', $_SERVER['HTTP_X_FORWARDED_FOR']);
define('ALT_IP', $this->alt_ip);
}

Now the proxy details aren't written properly, but that's not that important for me. At least I see the real IP addresses now.


Where would I place this in the class_core.php??

Dave

boggseric
08-20-2013, 02:04 AM
That sounds fine to me.

However - if you just install the new one, without uninstalling the old one, the new one will remove the old product without running the uninstall code anyway.

Same effect, less effort. :)

Yes, you are right. That does sound much easier. Thanks!

ForceHSS
08-20-2013, 02:40 AM
When installed is there any options for it if yes were

Paul M
08-20-2013, 09:07 PM
When installed is there any options for it if yes were

Huh ?

I cannot make sense of the question.

ForceHSS
08-20-2013, 10:29 PM
Huh ?

I cannot make sense of the question.

Clear to me, is there any options for this plugin

Paul M
08-21-2013, 10:46 PM
No, this has no settings or options.

Dark Pulse
08-26-2013, 03:27 PM
I unfortunately can't seem to get this to work - all my users' IPs are detected as Cloudflare IPs, and my host is swearing mod_cloudflare is installed on the server as well.

Unless there was some kind of changes in 4.2.1 that 4.2.0 does not have, but I've done the required edits, and triple-checked to make sure they're properly set in class_core.php, so I really don't know why it's failing to properly pick up the IPs, since I'd assume that Cloudflare is "playing nice" and properly forwarding stuff (i.e; not being an anonymous reverse proxy).

EDIT: I stand corrected, some proxies are being properly detected. It's doing absolutely nothing for Cloudflare, though.

dandanch
10-14-2013, 01:38 AM
This doesn't seem to work with clouldflare, paul would it be possible to get this hack to work with CF?

Paul M
10-15-2013, 08:59 PM
Cloudfare seem to think it does, or at least it used to.

See https://support.cloudflare.com/hc/en-us/articles/200170856-How-do-I-restore-original-visitor-IP-with-vBulletin-

dandanch
10-16-2013, 04:49 PM
It might still be working but just not on my end - Anyway, I integrate mod_cloudflare and now we can see the real ip's and not Cf, but I'm still using yours.

Pocket Aces
10-19-2013, 08:34 AM
Is this mod applicable to VPN or anonymity software (eg. hotspotshield (http://www.hotspotshield.com/)) users?

GuiltyNL
11-01-2013, 04:16 PM
Does this mod work well together with Proxy Alert? It is nice to see the red IP icon, but I would also like to be able to block them automatically using Proxy Alert and or receive PM's / emails and that is supported by Proxy Alert.

https://vborg.vbsupport.ru/showthread.php?t=299546

Disco_Dave
11-25-2013, 08:24 AM
Getting a warning message when this is running now vb4.2.2

Warning: Assigning the return value of new by reference is deprecated in ..../includes/cron/cronbackup.php on line 18

Warning: Function set_magic_quotes_runtime() is deprecated in ..../includes/cron/cronbackup.php on line 13

Dave

tbworld
11-25-2013, 09:52 AM
Getting a warning message when this is running now vb4.2.2

Warning: Assigning the return value of new by reference is deprecated in ..../includes/cron/cronbackup.php on line 18

Warning: Function set_magic_quotes_runtime() is deprecated in ..../includes/cron/cronbackup.php on line 13Dave

The mod that has the warning is:
vBulletin Cron Based Database Backup
https://vborg.vbsupport.ru/showthread.php?t=231481&highlight=cron+backup

it is not this mod...

In /includes/cron/cronbackup.php on line 18
Find:

$mysqlBackup = &new mysqlBackup($vbulletin->db, $vbulletin->options);
Replace:

$mysqlBackup = new mysqlBackup($vbulletin->db, $vbulletin->options);
This is a warning not an error.

Disco_Dave
11-25-2013, 10:14 AM
The mod that has the warning is:
vBulletin Cron Based Database Backup
https://vborg.vbsupport.ru/showthread.php?t=231481&highlight=cron+backup

it is not this mod...

In /includes/cron/cronbackup.php on line 18
Find:

$mysqlBackup = &new mysqlBackup($vbulletin->db, $vbulletin->options);
Replace:

$mysqlBackup = new mysqlBackup($vbulletin->db, $vbulletin->options);
This is a warning not an error.


Cheers I actually wasn't meant to post in this thread, just picked the wrong one on Paul's profile......Please move if possible. Thanks for the fix!

Dave

Nirjonadda
12-28-2013, 05:33 PM
In the changes to the class_core.php file what is Line No ? Anyone can changes to the class_core.php file than upload for vBulletin 4.2.2 ?

rrhill
03-30-2014, 02:41 PM
Thank you very much for this solution, it works great in vBulletin 4.22

xhells21
04-12-2014, 01:07 PM
Thanks for this mod! It works, I got a little visual problem. If someone is able to help me solve this, would be greatly appreciated.
https://vborg.vbsupport.ru/external/2014/04/30.png

fxdigi-cash
04-22-2014, 01:32 PM
I tried this mod, but no real ip has shown to me!!

I have a VPS and using Nginx so I don't see why this mod doesn't work anyways since Nginx always detect the real IP!!!

any idea??

Bozza
05-17-2014, 07:22 AM
I'm trying to install this (as I run CloudFlare) and the install seems to go ok...

Importing Product, Please Wait...

[:]

Real IP Detection

Installing : 4.2.0.0

Please remember to Mark as Installed at vBulletin.org

...but I'm then not seeing this listed in my installed products and I'm still getting CloudFlare IP addresses. Any clues?

Calahan
05-28-2014, 02:57 PM
Hello
When add the code to my class_core.php all the ? and ? ... change to � in my board
Any idea what I am doing wrong?
I used notepad via Filezilla to change the class_core

Paul M
05-29-2014, 11:42 AM
The text edtitor is breaking the utf8 chars, try a different editor.

hsoen
10-06-2014, 08:21 AM
If you are installing 4.2.0.0 version, you need to add below step 1 (from 4.1.0.8) in addition to step 2 (from 4.2.0.0).

-----------------------------------------------------------------------------------------------------------
Step 1 (THIS STEP IS NOT REQUIRED IN vBulletin 4.1.7 - IT *IS* REQUIRED IN ALL OTHER VERSIONS, INCLUDING 4.1.8 ONWARDS).

In class_core.php ;

Find ;

// fetch client IP address
$registry->ipaddress = $this->fetch_ip();
define('IPADDRESS', $registry->ipaddress);

// attempt to fetch IP address from behind proxies - useful, but don't rely on it...
$registry->alt_ip = $this->fetch_alt_ip();
define('ALT_IP', $registry->alt_ip);

Replace with ;

// Paul M - Get ip addresses.
$registry->ipaddress = $this->fetch_ip();
$registry->alt_ip = $this->fetch_alt_ip();

// Check that alt_ip is valid address, reset to original if not.
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $registry->alt_ip, $iplist))
{
$registry->alt_ip = $iplist[0];
}
else
{
$registry->alt_ip = $registry->ipaddress;
}

// Set ip constants.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->ipaddress);
}
else
{
define('ALT_IP',$registry->alt_ip);
define('IPADDRESS',$registry->alt_ip);
define('PROXYIP',$registry->ipaddress);
$registry->ipaddress = $registry->alt_ip;
}

-----------------------------------------------------------------------------------------------------------
Step 2.

In class_core.php ;

Find ;

if ($proxy)
{
define('ALT_IP', $this->ipaddress);
define('IPADDRESS', $this->alt_ip);
}

Insert above it ;

// Detect ALL.
if ($registry->ipaddress == $registry->alt_ip)
{
define('PROXYIP','');
}
else
{
$proxy = true;
define('PROXYIP',$registry->ipaddress);
}

-----------------------------------------------------------------------------------------------------------

del Drago
12-30-2014, 02:32 PM
This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

graphicsarea
12-30-2014, 07:16 PM
This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

Like Me :down:

madness85
12-30-2014, 10:57 PM
Like Me :down:

Option 2 I used https://support.cloudflare.com/hc/en-us/articles/200170856-How-do-I-restore-original-visitor-IP-with-vBulletin-

Master Of Unive
12-30-2014, 11:32 PM
Option 2 I used https://support.cloudflare.com/hc/en-us/articles/200170856-How-do-I-restore-original-visitor-IP-with-vBulletin-

I can confirm that only option 2 working.

Paul M
12-31-2014, 12:28 AM
This mod does not work. I'm attempting to use it with Cloudflare (at Cloudflare's recommendation), and I'm still only seeing Cloudflare IP addresses within vBulletin.

The mod works just fine, please do try and get your facts straight before making sweeping statements ;)

It will no longer work with Cloudfare because they changed their system to use a custom http variable called HTTP_CF_CONNECTING_IP, instead of the standard HTTP_X_FORWARDED_FOR.

del Drago
01-02-2015, 06:10 PM
Thanks for clarifying the situation, Paul. Cloudflare needs to stop directing people to this mod, because they are causing a lot of unnecessary confusion.

thetechgenius
01-02-2015, 06:49 PM
Will this work for vB 4.1.4 ?

ozzy47
01-02-2015, 06:54 PM
As stated in the first post.

For vBulletin 4.1.0 Onwards

Paul M
01-02-2015, 09:18 PM
Thanks for clarifying the situation, Paul. Cloudflare needs to stop directing people to this mod, because they are causing a lot of unnecessary confusion.
I wasnt aware they were, but its easy enough to modify it to work with them.

In addition to the install instructions provided, just do this ;

In class_core.php ;

Find ;

if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$altip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}


Replace with ;

if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$altip = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$altip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}



No need to perform their option 2 then.

I've included this in the instructions for v4.2.0.1