Re: [development] No last access?
Well, I spent sunday evening being sick and looking over last access functionality historically as per Bérs advice. I looked back to version 4.4 to 4.7.4. a found surprisingly that Drupal has never really had a last access functionality. It has had calculation code to gather such information but nothing definative. Strangely enough there has not been too much call for this information so no one has noticed. The reason that I was getting a last access previously is because the re was another (ws_auth) module loading the database. This module was only on my 4.7.4 test site not on later versions. So what I did was create a last access routine based on hook_user to satisfy my needs. I will post a feature request on this as there may be a greater need in the future for this to be a part of the API. Carl Mc Dade ____________________________ Web Developer ----- Original Message ---- From: Carl Mc Dade <carl_mcdade@yahoo.com> To: development@drupal.org Sent: Sunday, February 11, 2007 1:33:27 PM Subject: Re: [development] No last access? Yep, I am digging further. It looks like the order of process has changed. I tried to use hook_user to place my own timestamp in the database. This did not work. It seems that all user functions are after update. I will comeback with more information after more study of the behaviour. Carl Mc Dade ____________________________ Web Developer ----- Original Message ---- From: Bèr Kessels <ber@webschuur.com> To: development@drupal.org Sent: Sunday, February 11, 2007 12:22:59 PM Subject: Re: [development] No last access? Op zondag 11 februari 2007 10:36, schreef Carl Mc Dade:
This does not seem to be a problem in 4.7.4 but in 4.7.5+ and 5.1 calling user_load() functions $user->access and $user->login give the updated values and not the actual value in the database.
There were some security related changes made to the user _insert and _update. Maybe thye have to do with this? I suggest you browse through the cvs logs of user module to isolate the cahnges that cause this behaviour. Once identified, and detailed, I am sure there are people willing to help you solve the issue. It hmight have been an intentional change, it might have been a new bug introduced by one of the security fixes. Bèr -- Drupal, Ruby on Rails and Joomla! development: webschuur.com | Drupal hosting: www.sympal.nl Don't get soaked. Take a quick peak at the forecast with theYahoo! Search weather shortcut. ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com
Carl Mc Dade wrote:
Well, I spent sunday evening being sick and looking over last access functionality historically as per Bérs advice. I looked back to version 4.4 to 4.7.4. a found surprisingly that Drupal has never really had a last access functionality. It has had calculation code to gather such information but nothing definative. Strangely enough there has not been too much call for this information so no one has noticed.
This is all nonsense. The user admin page shows you last access for each user. And that number is accurate, so we must be collecting that info somewhere. Furthermore, access is easily available for all modules in the standard $user object. Fire up your debugger and you will see the writing of this infomation in sess_write().
I can imagine the the global user might not have the info in it... but if you do user_load(array('uid' => $user->uid)); // <-- $user is global user, you might get a hold of it. Just shooting from the hip. Moshe Weitzman wrote:
Carl Mc Dade wrote:
Well, I spent sunday evening being sick and looking over last access functionality historically as per Bérs advice. I looked back to version 4.4 to 4.7.4. a found surprisingly that Drupal has never really had a last access functionality. It has had calculation code to gather such information but nothing definative. Strangely enough there has not been too much call for this information so no one has noticed.
This is all nonsense. The user admin page shows you last access for each user. And that number is accurate, so we must be collecting that info somewhere. Furthermore, access is easily available for all modules in the standard $user object.
Fire up your debugger and you will see the writing of this infomation in sess_write().
-- * * * * * Lullabot's First Ever Advanced Workshops Are Here! Drupal API & Module Building - Advanced Drupal Themeing April 9th-13th - Providence, RI Early Bird Discounts Available Now http://www.lullabot.com/training * * * * *
http://drupal.org/node/91786 "user_load() clarification"
I can imagine the the global user might not have the info in it... but if you do user_load(array('uid' => $user->uid)); // <-- $user is global user, you might get a hold of it. Just shooting from the hip.
Moshe Weitzman wrote:
Carl Mc Dade wrote:
Well, I spent sunday evening being sick and looking over last access functionality historically as per Bérs advice. I looked back to version 4.4 to 4.7.4. a found surprisingly that Drupal has never really had a last access functionality. It has had calculation code to gather such information but nothing definative. Strangely enough there has not been too much call for this information so no one has noticed.
This is all nonsense. The user admin page shows you last access for each user. And that number is accurate, so we must be collecting that info somewhere. Furthermore, access is easily available for all modules in the standard $user object.
Fire up your debugger and you will see the writing of this infomation in sess_write().
-- * * * * * Lullabot's First Ever Advanced Workshops Are Here! Drupal API & Module Building - Advanced Drupal Themeing April 9th-13th - Providence, RI Early Bird Discounts Available Now http://www.lullabot.com/training * * * * *
participants (4)
-
Carl Mc Dade -
John VanDyk -
Moshe Weitzman -
Robert Douglass