[imp] RC3 last login?
Paul Reilly
pareilly@tcd.ie
Tue, 21 May 2002 13:19:49 +0100 (IST)
> Did I say I have this done? :-)
>
No. I was just hoping. I didn't think I could fix this myself, but
from the pointers I got from you, I've been able to fix it. I just
copied the code from IMP-3.0's mailbox.php 2.296.2.13 in to mailbox.php
2.296.2.33. It displays the login time now, but for some reason the login
time is not the last login time, but *this* login time. Something else
must be setting the login time before we get to mailbox.php. Any ideas
where I should look?
Here's the diff of what I changed.
Paul
118,140d117
< //---------------------------------------------------------------
< // Hack to get last login shown
< //---------------------------------------------------------------
< /* Get UNIX timestamp of the last time the user logged in. */
< $last_login = $prefs->getValue('last_login');
<
< /* 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)) {
< Horde::raiseMessage(_("Last login: Never"), HORDE_MESSAGE);
< } else {
< Horde::raiseMessage(sprintf(_("Last login: %s"), strftime(_("%A, %B %e, %Y, %I:%M:%S %p %Z"), $last_login)), HORDE_MESSAGE);
< }
< }
<
< /* Store the current login timestamp now. */
< if (empty($last_login)) {
< $prefs->add('last_login');
< }
< $prefs->setValue('last_login', time());
< //---------------------------------------------------------------
<