User Access Times

vinode - February 22, 2005 - 23:43
Project:Opt-in
Version:4.5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed
Description

Using the opt-in module seems to "break" the Last Access feature when viewing the list of users. Any user who has opted into a role will now have a Last Access time of the hour just gone i.e. if it is no 22:30, their access times will all be 22:00, if it is now 23:12, their access times will be 23:00. Presumably, this is something to do with the way roles are updated with cron.php.

#1

njivy - February 25, 2005 - 02:00

optin.module uses the standard Drupal API for modifying users -- i.e. user_save(). I don't see how user_save() could cause the problem you describe. (See the following code from line 129.) I recommend submitting a bug report to the "user system" in the Drupal project.

#2

njivy - February 25, 2005 - 02:01

Oh yeah ... the code. Here's what I'm looking at in user.module:

db_query("UPDATE {users} SET $query changed = %d WHERE uid = %d", array_merge($v, array(time(), $account->uid)));

Notice the current time hardcoded with time(), which returns a unix timestamp. My guess is that something else is causing the behavior you described.

 
 

Drupal is a registered trademark of Dries Buytaert.