Under 4.7.1, all "Last Seen" dates show "36 years 22 weeks". This is from the following CVS version:

// $Id: members.module,v 1.38 2006/02/23 05:19:32 walkah Exp $

CommentFileSizeAuthor
#1 members_neverloggedin.patch610 bytesChrisKennedy

Comments

ChrisKennedy’s picture

Title: Incorrect "Last Seen" under Drupal 4.7.1. » "Never Logged In" not displayed properly
StatusFileSize
new610 bytes

The issue is that the users' login field is 0, because they're never logged in, and drupal is interpreting it as a date rather than a null value. Here's a patch to fix this problem:

--- _members.module.cvs 2006-10-07 14:26:40.000000000 -0500
+++ members.module  2006-10-07 14:33:07.000000000 -0500
@@ -124,7 +124,13 @@ function members_page($rids = null) {
             $data = theme_user_picture($account);
           }
           else if ($field == 'login') {
-            $data = format_interval(time() - $account->login);
+           if ($account->login == 0) {
+             // Never logged in
+             $data = t('Never logged in');
+           }
+           else {
+             $data = format_interval(time() - $account->login);
+           }
           }
           else {
             $data = $account->$field;
ChrisKennedy’s picture

Status: Active » Reviewed & tested by the community

RTBC unless someone finds a bug - very simple patch.

junyor’s picture

I find "access" to be a more accurate value than "login". Here's what I used instead of your suggested code:

$data = ($account->login) ? format_interval(time() - $account->access) : t('Never logged in');

junyor’s picture

Status: Reviewed & tested by the community » Needs review
walkah’s picture

Status: Needs review » Fixed

committed and branched. thanks, junyor!

Anonymous’s picture

Status: Fixed » Closed (fixed)