As site admin, I create a user. When I look at the user admin page immediately afterwards, the user shows up with a 'last access' time of '35 years 24 weeks ago'. Could we report 'Never' instead of the epoch, if the last access time is older than the user account?

I seem to recall a similar report, but I couldn't find it after searching through the issues for user.module, and issues in general.

Djun

CommentFileSizeAuthor
#2 epochuser.patch1.17 KBdeekayen
#1 wrong_last_access.png6.13 KBdeekayen

Comments

deekayen’s picture

StatusFileSize
new6.13 KB

I verified this on WinXP/PHP5.1. Screenshot attached.

deekayen’s picture

Assigned: Unassigned » deekayen
StatusFileSize
new1.17 KB

Attached patch shows "never" instead of epoch on new users with 0 as last visited value in the DB

puregin’s picture

The patch fixes the problem, thanks.

Are there other places in Drupal where this kind of message might occur?

Is it possible for the timestamp to be negative under any circumstances (if so, perhaps the test should be $account->access <= 0 rather than $account->access == 0)

Regards, Djun

deekayen’s picture

I could see how the timestamp might be negative if the DB record were a page you wanted to back-date, but here we're talking about a triggered action. I think it would make about as much sense for this to be negative as it would to see something in your Apache logs date back to 1834.

Besides, if the timestamp could be less than 0, you're taking about a whole new issue of the validity of using epoch to store time instead of a date/timestamp, because then <=0 would be valid times. To track whether someone visited or not, you'd have to store a new boolean for Visited/Not Visited.

deekayen’s picture

the rest of that comment is:

[less than or equal to zero] would be valid times. To track whether someone visited or not, you'd have to store a new boolean for Visited/Not Visited.

the [less than or equal to] sign I put in the comment got filtered out and cropped. Is that a known issue?

dries’s picture

Committed to HEAD. Thanks.

Anonymous’s picture