Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Insert IP address and current time/date stamp?

Quote Reply
Insert IP address and current time/date stamp?
I see gmail has the users IP visible from admin. I wondered how I could insert the current user IP and current time/date stamp into the templates? Are there tags for this?

Jason
Quote Reply
Re: [wickedmoon] Insert IP address and current time/date stamp? In reply to
Just write a global that returns $ENV{REMOTE_ADDR} for the user's IP. The current time is already in the nessa template, take a look at it.

Adrian
Quote Reply
Re: [brewt] Insert IP address and current time/date stamp? In reply to
I've not used globals before. I created one as follows: Code: ip_address, Description: $ENV{REMOTE_ADDR}, but that obviously needs a little more work. What do I need to do?

Jason
Quote Reply
Re: [wickedmoon] Insert IP address and current time/date stamp? In reply to
Code:
sub {
my $format = shift;
if (!$format or ref $format eq "HASH") {
$format = "%ddd% %mmm% %d%, %yyyy% %h%:%MM% %tt%";
}
require GT::Date;
return GMail->date(time, $format);
}
Code:
sub {
return $ENV{REMOTE_ADDR}
}

Adrian
Quote Reply
Re: [brewt] Insert IP address and current time/date stamp? In reply to
Hi Adrian.

How could the recent two IP data available in Admin be shown in user interface.? Last Login : IP Address
Present Login : IP Address

Thanks
Anup
Quote Reply
Re: [anup123] Insert IP address and current time/date stamp? In reply to
You can get this information from the user_logins table.

Adrian
Quote Reply
Re: [brewt] Insert IP address and current time/date stamp? In reply to
Hi.
Code:
sub {
my $tb = $DB->table('user_logins');
$tb->select_options('ORDER BY user_logins_date', 'LIMIT 10');
return $tb->select('user_logins_date', 'user_logins_ip', 'user_logins_lan', { user_logins_userid => $USER->{userid} })->fetchall_arrayref({});
}
Would this be ok?

Thnx
Anup

Last edited by:

anup123: Jul 3, 2004, 12:03 PM