[development] No last access?
Carl Mc Dade
carl_mcdade at yahoo.com
Mon Feb 12 17:54:10 UTC 2007
I would like the time of the last completed login. What I am using now is
function module_user($op, &$edit, &$account, $category = NULL) {
global $user;
if ($op == 'login') {
/// get the time of the last login
print "you have been away for 30 martian years";
}
}
Eric Goldhagen <eric at openflows.org> wrote: At 9:22 AM -0800 2/12/07, Carl Mc Dade wrote:
>Put simply (SQL Server english query style) I need to get
>
>"how long it has been since the user last visited"
>
>"the time/date of the users last visit"
>
>made available to a module when the user logs in.
by "last visit" do you mean the last time they
filled in the form and logged in, or the time
they last visited a page?
This is an important difference and one that
people have asked you to clarify so they can
assist. For example my last login to drupal.org
was almost 24 hours ago, the last time I visited
a page while logged in was about 30 seconds ago.
Which do you need available to your
function/module?
--Eric
>
>Carl Mc Dade
>____________________________
>Web Developer
>
>
>
>
>
>----- Original Message ----
>From: AjK
>To: development at drupal.org
>Sent: Monday, February 12, 2007 6:10:54 PM
>Subject: Re: [development] No last access?
>
>Carl,
>
>> Nope, That is updated first so their is no way of pulling
>> the old time code before the newer on sets. This is the
>> same problem as the access object. As matter of fact the
>> login ia updated a split second before the access time.
>>
>> access = 1171296985
>> login= 1171296984
>
>OK, let's go back to basics.... here's your question again:
>
>> Is there no longer a last access functionality?
>> using the global user and calling $user->access
>> gives the value after the database has been updated.
>> Not the value in the database at the time of login.
>> Ex. the value in the database table is 0000002.
>> You will not get this value but the value 0000003
>> which is the time of the latest access.
>
>The ->login is updated when a user logs in. It's updated
>just once at the login time. So I'm reading your question
>again and, if it's not ->login that you want you'll have
>to rephrase your question to make sense. I read your
>question as "I want the time the user actually logged in".
>
>Also, you might avoid the "confrontational" type responses
>by wording your question in a non-confrontational manner.
>"Is there no longer a last access functionality?" sounds
>like your accusing some Drupal Ninja Squirrel of stealing
>some of your nuts.
>
>How about posting:-
>
> "I want to find the time for this particular event... blah blah"
>
>Basically, what I want to know is what do you mean by "last access
>functionality"?
>
>We have
> ->login which is timestamp at login
> ->access which is timestamp at last browser hit
>
>You want
> ->something
>
>Define something.
>
>One point; "Nope, That is updated first so their is no way of pulling the
>old time code before the newer on sets". Erm, just how far back do you want
>to go? You are experimenting on global $user and so I assume you logged in
>to test, so I would expect recent values for ->login and ->access
>
>Imagine you are using user foo (eg uid = 1234). If you load that user object
>what you appear to asking for here is "when did that user login the time
>before the last login?". That's rather odd functionality to expect of any
>system except those that keep a record of every login time, forever.
>->login is "the last time the user logged in" not "the last time the user
>logged in before last".
>
>So, it seems your question and your responses to date have been a little
>unclear.
>
>regards,
>--Andy
>
>(ps, I'm trying to help ;)
>
>
>
>
>Need Mail bonding?
>Go to the
>Yahoo!
>Mail Q&A for
>great
>tips from Yahoo! Answers users.
--
-------------------------------------------
Openflows Community Technology Lab, Inc.
New York | Toronto | Montreal | Vienna
http://openflows.com
People are intelligent. Machines are tools.
Carl Mc Dade
____________________________
Web Developer
---------------------------------
8:00? 8:25? 8:40? Find a flick in no time
with theYahoo! Search movie showtime shortcut.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070212/81c30e3d/attachment-0001.htm
More information about the development
mailing list