[dev] PATCH Fix last login not saving every time.
Mike Cochrane
mike@graftonhall.co.nz
Thu, 8 Aug 2002 15:09:56 +0100
This is a fix for the last login not saving and for new users so it displays
'Never' correctly.
- Mike :-)
Index: imp/lib/Session.php
===================================================================
RCS file: /httpd/horde/imp/lib/Session.php,v
retrieving revision 1.8
diff -I$Horde -I$Revision -I$Date -u -r1.8 Session.php
--- imp/lib/Session.php 2002/08/06 02:32:54 1.8
+++ imp/lib/Session.php 2002/08/08 14:07:22
@@ -186,7 +186,7 @@
/* Display user's last login time if requested. */
/* Optional UNIX date style: "D M j H:i:s T Y" */
if ($prefs->getValue('show_last_login')) {
- if (empty($last_login)) {
+ if (empty($last_login) || $last_login == 0) {
$notification->push(_("Last login: Never"), 'horde.message');
} else {
$notification->push(sprintf(_("Last login: %s"),
strftime(_("%c"), $last_login)), 'horde.message');
@@ -210,7 +210,8 @@
/* Store the current login timestamp now. */
$prefs->setValue('last_login', time());
-
+ $prefs->store();
+
$_SESSION['imp']['_login'] = null;
}
}
-------------------------------------------------------------------------
This mail sent from Mike's CVS HEAD install of IMP: http://horde.org/imp/