Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoIP ServerBased not working when ip masquerading is enabled #3463

Closed
anonymous-matomo-user opened this issue Oct 21, 2012 · 3 comments
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

I found that I still had to have the GeoIP databases in the misc folder even though the server based geoip processing is enabled which means that the server based info is not used.

The issue is, in my opinion, in ServerBased.php in the beginning of the getLocation function:

    public function getLocation( $info )
    {
        // geoip modules that are built into servers can't use a forced IP. in this case we try
        // to fallback to another version.
        $myIP = Piwik_IP::getIpFromHeader();
        if ($info['ip'] != $myIP
            && (!isset($info['disable_fallbacks'])
                || !$info['disable_fallbacks']))
        {

If you are anonymizing the IP address it will never match the one from the header or the one returned from the ServerBased localization.
The header contains the full ip address and the server based localization also returns the full ip address but piwik - internally - has the anoymized ip address which is just rarely the same.

I'd suggest to either leave out that check or apply the same anonymization to the $myIP as to the one send into this function.

@anonymous-matomo-user
Copy link
Author

see also http://forum.piwik.org/read.php?2,95296 .

@mattab
Copy link
Member

mattab commented Oct 21, 2012

Thanks for the report!

We'll check that it works OK with IP anonymization on.

@diosmosis
Copy link
Member

(In [7285]) Fixes #3463, allow serverbased geoip provider to work w/ anonymized IPs & add description about this issue in provider description.

@anonymous-matomo-user anonymous-matomo-user added this to the 1.9.1 - Piwik 1.9.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants