Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

IP override with same IP detects different country

IP override with same IP detects different country

Hi

It looks like I've got metamod installed correctly, but I am experiencing some odd behaviour, hopefully it's just a configuration issue you can help me with please.

I am in South Africa and my IP address is correctly identified as South African on numerous GeoIP sites (including maxmind) but when I turn on MetaMod debug info it displays my country as the United Kingdom?

I included the following PHP recipe to display my IP address:
echo $_SERVER['REMOTE_ADDR'];

Metamod debug info:
Module ID: 87
$option: com_content
$view: featured
$id:
$Itemid: 101
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Country: GB
Country Name: United Kingdom
(IP:) xxx.xxx.xxx.xxx
Including modules: cookie

The crazy thing though is that if I insert the very same IP address as displayed by the metamod debug info into the IP override field, then it displays my country correctly as South Africa?

With IP override set to xxx.xxx.xxx.xxx

MetaMod debug info:
Module ID: 87
$option: com_content
$view: featured
$id:
$Itemid: 101
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Country: ZA
Country Name: South Africa
(IP:) xxx.xxx.xxx.xxx (as inserted in IP override)
Including modules: cookie

I am running MetaMod v3.8, 2012-02-14 on Joomla! 2.5.1.

Please could you help me out?
Thanks.

Edited By: richelectron
16-Feb-12 09:59:37

richelectron
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: IP override with same IP detects different country

Ok, that's really weird, not sure what's going on there. The GB is inserted as a default value, which means that somehow it's failing to pick up the correct value. Unfortunately I don't have an online test installation of J2.5 at this time (only local, which doesn't help for testing this), and I'm travelling at the moment and don't have a lot of bandwidth to use setting one up. It's probably just a tiny issue somewhere... sorry I can't look at it till the 1st week of March.

Sorry about that - but adding it to the to-do list.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: IP override with same IP detects different country

Thanks for the feedback - sorry to make head aches for you. Maybe I'll have a look and see if I can hack a fix before you get to it and I'll let you know if I manage to find anything. Enjoy the rest of your travels!

richelectron
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: IP override with same IP detects different country

It looks like the problem is unique to my work connection. I tested this from another South African connection and it worked as expected.

I think for now I may just use getenv('REMOTE_ADDR') to detect the visitor IP address (in the getUserIP function in the helper.php file)

Thanks.

richelectron
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: IP override with same IP detects different country

Hmmm, I think this may happen if your server is hosted in your work environment (e.g. in a DMZ), and the IP address that it sees for your workstation is on your internal network rather than an external IP address. In that case it's quite rightly coming up with the default value (present as GB).

Can you confirm if that's the case?

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: IP override with same IP detects different country

Hi Stephen

You are right about it trying to use my local machine IP address. However, my server is not hosted in my work environment - it's on Rackspace Cloud sites.

It's working great for my purposes though - thanks for a really handy plugin.

richelectron
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
7
User Info:
 
Total Users:
5418
Newest User:
outsd2
Members Online:
0
Guests Online:
155

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked