setting for IP address detection in core.input.php
Posted: 29 July 2008 12:57 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

I luckily came across this thread that discusses an IP address detection issue on mosso hosts (and this one over here too) today after panicking when I saw that a LOT of new members were all on IP address 172.16.10.1.

Essentially we just need a setting to switch between using $_SERVER[‘REMOTE_ADDR’] and $_SERVER[‘HTTP_X_CLUSTER_CLIENT_IP’].

Simple and it makes upgrade paths much simpler. Thanks!

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 02 September 2008 04:45 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  01-24-2006

Please add my vote for this.

 Signature 

Newism - Newcastle Web Design & Development

Profile
 
 
Posted: 02 September 2008 04:49 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

I haven’t seen anybody but Mosso do this, is that a standard variable? Either way, all that should be required for EE is something like

if (array_key_exists('HTTP_X_CLUSTER_CLIENT_IP', $_SERVER)) {
            $_SERVER[
'REMOTE_ADDR'] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
    
}


 
... so that might be an easy FR smile

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 02 September 2008 04:52 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  01-24-2006

Leevi just suggested I add this to index.php in the site root:

if (isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) === TRUE)
{
    $_SERVER[
'REMOTE_ADDR'] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
}

Worked a treat smile

Does that constitute a hack? Or is editing index.php kosher?

 Signature 

Newism - Newcastle Web Design & Development

Profile
 
 
Posted: 02 September 2008 11:37 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

Occasionally index.php may need to be updated during the course of a version update - so it would still be a hack that you need to manually re-instate with each update.

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65086 Total Logged-in Users: 39
Total Topics: 82224 Total Anonymous Users: 14
Total Replies: 441921 Total Guests: 197
Total Posts: 524145    
Members ( View Memberlist )