Bug #1564
closedJoomla 1.5: Last online offseted by the server offset
Description
In Joomla 1.5 at registration, then first login (but seems any other login too), the last-online is offseted.
Might be related to some reports of bug #82 .
http://www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/id,81908/catid,70/
Findings of Kyle:
I've located the update of the actual last visit time. It's loaded at:
\libraries\joomla\database\table\user.php
Line: 292
function setLastVisit( $timeStamp=null, $id=null )
I then traced this function to:
\libraries\joomla\user\user.php
Line: 274
function setLastVisit($timestamp=null)
The trigger is found at:
\plugins\user\joomla.php
Line: 75
function onLoginUser($user, $options = array())
With $instance->setLastVisit(); commented out then the insert is not made. So the variables are being passed through that from somewhere somehow. I can't seam to trace it anywhere beyond this point. I believe it's the onlogin trigger in CB, but I can't find it.
In \libraries\joomla\database\table\user.php I changed $date->toMySQL() to date( 'Y-m-d H:i:s' ) and the date/time was then correct. $date is derived from $date =& JFactory::getDate($timeStamp); so it all leads back to $timestamp, which I can't seam to find out what in CB is passing through to timestamp or where from.
Reviewing the database entires I can conclude exactly 6 hrs is being added on to the time for some absurd reason, but can't locate where these 6 hours is coming from.
This is a joomla 1.5 bug (even without CB):
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=14451
Confirmed joomla 1.5 bug:
http://www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/id,87966/catid,77/limit,6/limitstart,6/
Open ../libraries/joomla/database/table/user.php
locate the line that reads
. ' SET lastvisitDate = '.$this->_db->Quote($date->toMySQL())
and replace it with
. ' SET lastvisitDate = '.$this->_db->Quote(date( 'Y-m-d H:i:s' ))
As joomla wont' fix it, we will have to work-around...
Updated by beat almost 15 years ago
Patch should work-around as follows:
in cb.tables.php in function saveSafely: when it's a new record, load it and set lastvisitDate to be same as RegisteredDate (or actually 0000-00-00)
Updated by krileon almost 15 years ago
- Status changed from Assigned to Feedback
- Assignee changed from krileon to beat
This does not resolve it. That simply sets it as empty (0000-00-00 00:00:00) at registration, which it already does (not the issue). Upon login Joomla adds the information to the _users table for firsttime login. Possibly something to add to CB Authentication library after a user has logged in? Couldn't duplicate locally in J1.5.15 (offset of 5hrs always added.. maybe is actually server config related).
Updated by beat almost 15 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
r941 fixes this bug.