Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Excluding IPs w/o mod_php

tvine
Minted
Posted on Apr 06, '07 at 08:51 pm

I have just purchased Mint but have hit a snag.

I need to be able to exclude 3 specific IPs from statistics collection or reporting.

I found the auto.php method that requires php be run as an Apache module, but my environment is not set up that way.

Before I give up on Mint, are there other options?

tvine
Minted
Posted on Apr 07, '07 at 02:25 pm

More on this:

I have installed Crushes, and I see that it’s got IPs to display. So, perhaps I can exclude my 3 IPS via direct SQL? Or, maybe I could write a Pepper to take care of it?

Any advice or pointers much appreciated!

Till
Pepper Developer
Posted on Apr 07, '07 at 03:47 pm

You can’t exclude IP addresses, but you could delete records or change mint (quite easy).

Till
Pepper Developer
Posted on Apr 07, '07 at 06:02 pm

Search in /mint/app/record/js.php for:
if (isset($_COOKIE['MintIgnore']) && $_COOKIE['MintIgnore']=='true')

Replace by:
if (in_array($_SERVER['REMOTE_ADDR'], array('192.168.0.0', '10.0.0.0', '172.16.0.0')) || (isset($_COOKIE['MintIgnore']) && $_COOKIE['MintIgnore']=='true'))

And simply change the ip address array.

tvine
Minted
Posted on Apr 07, '07 at 08:58 pm

Thank you Till, I’ll give it a try!

tvine
Minted
Posted on Apr 07, '07 at 10:19 pm

This worked like a charm - thank you!

For others trying this, in my code distribution I found the file as: /mint/app/paths/record/js.php

GTNman
Minted
Posted on Jun 08, '07 at 10:07 am

I did this as above, however by adding just a single IP address to restrict it stopped tracking all pages. Is it not an array for a single IP address?

GTNman
Minted
Posted on Jun 08, '07 at 10:08 am

whoops on a double post.

Hank
Minted
Posted on Oct 29, '07 at 04:55 am

Did that change?

/mint/app/paths/record/js.php there I can’t find the line:

if (isset($_COOKIE['MintIgnore']) && $_COOKIE['MintIgnore']=='true')

Shaun Inman
Mint/Pepper Developer
Posted on Oct 29, '07 at 10:22 am

Check your advanced preferences (/mint/?preferences&advanced) to add IP addresses to exclude.

Hank
Minted
Posted on Oct 29, '07 at 12:44 pm

Oops, thanks!

You must be logged in to reply. Login above or create an account