Previous Thread
Next Thread
Print Thread
Hop To
Joined: Dec 2006
Posts: 7
W
stranger
stranger
W Offline
Joined: Dec 2006
Posts: 7
We just moved out forum box behind an F5 loadbal/proxy, as part of getting all our machines behind it, even if they aren't load balanced. However, now, all members are logged by the IP of the F5 rather than their origin IP. The F5 is sending the X-Forwarded-For header correctly, but ubb doesn't seem to use this.

How can I config ubb to log members based on the X-Forwarded-For header rather than our proxy address?

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
You'd probably need to change a few scripts depending on version. If you look for any files in the scripts and libs directories where it gets REMOTE_ADDR then you could change that to the environment variable that you actually need.

Joined: Dec 2006
Posts: 7
W
stranger
stranger
W Offline
Joined: Dec 2006
Posts: 7
yeah, I did a quick search on REMOTE_ADDR before I saw your reply, and found it in the following scripts.

libs/captcha.inc.php:
libs/includepoll.inc.php:
libs/ubbthreads.inc.php:
libs/mysql.inc.php:
libs/phpmailer/class.phpmailer.php:
scripts/captcha.inc.php:
scripts/addpost.inc.php:
scripts/adduser.inc.php:
scripts/dopoll.inc.php:
scripts/shoutit.inc.php:
scripts/start_page.inc.php:

Which is a fair amount to go poking around in.
Most of them are of the form

$ip = find_environmental('REMOTE_ADDR');

so changing them to

$ip = find_environmental('X_FORWARDED_FOR');

should work without too much anguish.

The captcha seems to use it as part of generating unique image names. Of course, making this change will mean that the forums wouldn't work if they *weren't* behind a proxy that sent the X_FORWARDED_FOR header, but that's a different issue.

Oh, and we are currently running UBBThreads 7.1, and plan on upgrading in the not to distant future to the latest version.



Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
We'll need to put in a central function for this in an update so it's not scattered all over the place. Maybe even a control panel option where it can be decided which IP should be grabbed.

Joined: Dec 2006
Posts: 7
W
stranger
stranger
W Offline
Joined: Dec 2006
Posts: 7
That would be my preference, a clicky button, an option. For now, we'll probably make a change to our existing setup, and hope that the clicky button is there when we upgrade later. Thanks.

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I figured we'd have a config variable $ip that could be "easily" updated...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2006
Posts: 7
W
stranger
stranger
W Offline
Joined: Dec 2006
Posts: 7
that'd work fine for me.

Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
What is the status of this? My hoster change his server and now we have a localhost ip address problem. Will bring V8 support for this?


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Yes, we're going to put in a few options to account for this in v8.

Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Sounds nice. Thank you.


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Feb 2014
Posts: 6
stranger
stranger
Joined: Feb 2014
Posts: 6
Is the X-Forwarded-For header options included in 7.5.8?

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Originally Posted by jeanettes
Is the X-Forwarded-For header options included in 7.5.8?
No; it would require modifying the coding if this functionality would be required.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 541 guests, and 181 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)