Gossamer Forum
Home : Products : Gossamer Mail : Development, Plugins and Globals :

Display and log IP and referral URL

Quote Reply
Display and log IP and referral URL
First, congrats on GM. I'm running 2.1.1 and everything works just dandy :)

Request: I'm not sure if this requires a Global or a plugin. I would like to display the surfers IP and referrer URL and also capture this data to a .txt file along with a time and date stamp. In many respect it's similar to what LinksSQL does with the new listing submit email to the admin.

This plugin would be inserted in the signup page and login page. As I'm confident most of you are aware of, this provides "evidence" and an audit trail for abusers and even those sharring a password/username when they should not be.

Nothing fancy like a new column, just a quick and dirty fix please :)

Thanks in advance.

geek/talk Forums @ GeekVillage.com
Quality Forums For Webmasters & Merchants

Quote Reply
Re: [Steve_S] Display and log IP and referral URL In reply to
Hi,

You could just create a global on signup success that does something like:

open (L, ">> /path/to/log.txt") or die "open failed ($!)";
print L "New user: " . $IN->param('email') . "\n";
print L " from $ENV{REMOTE_ADDR} $ENV{REMOTE_HOST}\n";
print L " at " . scalar localtime . "\n\n";
close L;

(may need to double check that the 'email' name is correct.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Display and log IP and referral URL In reply to
Thanks so much Alex. I will give this a try over the weekend

geek/talk Forums @ GeekVillage.com
Quality Forums For Webmasters & Merchants