?
avatar GeoTimber
GeoTimber
15 Mar 2016

Steps to reproduce the issue

Create an account and login in the same session

Expected result

LastvisitDate in the #_users table to be set to the login time

Actual result

LastvisitDate stays at 0000:0000:0000:0000 until you login in a new session

System information (as much as possible)

Joomla 3.4.8

Additional comments

am I missing something, should I clear something for this to work, this is rather odd.

avatar GeoTimber GeoTimber - open - 15 Mar 2016
avatar brianteeman
brianteeman - comment - 15 Mar 2016

You havent done a last visit until the first visit is over.

On 15 March 2016 at 15:13, Joris Ceelen notifications@github.com wrote:

Steps to reproduce the issue

Create an account and login in the same session
Expected result

LastvisitDate in the #_users table to be set to the login time
Actual result

LastvisitDate stays at 0000:0000:0000:0000 until you login in a new session
System information (as much as possible)

Joomla 3.4.8
Additional comments

am I missing something, should I clear something for this to work, this is
rather odd.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#9436

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar GeoTimber
GeoTimber - comment - 15 Mar 2016

ahh clever...
but too clever
most people just expect it to be the time/date you last logged in or better last time you made a request, so having it show "NEVER" as it does now in the backend control panel makes no sense, since the user is actually visiting that moment.

avatar brianteeman
brianteeman - comment - 15 Mar 2016

It is called last visit not last logged in so it makes perfect sense for
what it is supposed to be. You want it to be something different

On 15 March 2016 at 15:45, Joris Ceelen notifications@github.com wrote:

ahh clever...
but too clever
most people just expect it to be the time/date you last logged in or
better last time you made a request, so having it show "NEVER" as it does
now in the backend control panel makes no sense, since the user is actually
visiting that moment.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9436 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar GeoTimber
GeoTimber - comment - 15 Mar 2016

man.. you freak me, you think to difficult

when you invite your neighbours over for a visit , he comes and then he goes away, you can't say then his last visit date was NEVER, this is what it does now.

the user is visiting at the moment, is current logged in and when I do a search in the backend on that user it says in the last visit date NEVER, even after he goes away it will keep saying NEVER as a last visit date until he visits again in a new session.

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Mar 2016

You havent done a last visit until the first visit is over.

when you invite your neighbours over for a visit , he comes and then he goes away, you can't say then his last visit date was NEVER, this is what it does now.

Nice conversation :D

avatar GeoTimber
GeoTimber - comment - 15 Mar 2016

Don't worry, I do really appreciate @brianteeman, I often wear my IT hat and try to apply strict logical rules, but I do freak myself sometimes too by missing something obvious and the end user suffers because he cannot understand what is happening, and I feel Joomla is a bit like that for the end user sometimes.

In this case I think the user misses out on a visit, and it shows the wrong information in the backend report, can anybody else give an opinion?

avatar brianteeman
brianteeman - comment - 15 Mar 2016

Sorry I was completely wrong. Serves me right for doing it from memory.

I have just checked and the record is created on login not logout so your expectation was correct and I was wrong

However when I went to check that this was indeed happening (or not as you stated) then it did correctly create a timestamp as soon as I logged in. So your expectation was correct but I cannot replicate your bug report.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9436.

avatar GeoTimber
GeoTimber - comment - 15 Mar 2016

okay I will get back to you let me verify that, I need to do a few things now first but I will get back to you and I definitely have this issue in some way or another.
Thanks @brianteeman

avatar brianteeman
brianteeman - comment - 15 Mar 2016

What i didnt test was self registration. I was creating site in the admin and then using it in he front end


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9436.

avatar GeoTimber
GeoTimber - comment - 16 Mar 2016

Ok I will test that, those are two different sessions I think as you can
log-in as a different users in front and backend at the same time.

It may take a few days before I get back, I will get back. Joris

On 2016-03-15 20:22, Brian Teeman wrote:

What i didnt test was self registration. I was creating site in the admin and then using it in he front end

This comment was created with the J!Tracker Application [1] at issues.joomla.org/joomla-cms/9436 [2].

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub [3]

POQUEIRAWEB.COM [4]

  • 34 659 279 692

IDEAS@POQUEIRAWEB.COM

This message was sent with Roundcube, free open-source software
licensed with the GNU General Public License 5 Version 3.

Our office is 100% solar powered.

Links:

[1] https://github.com/joomla/jissues
[2] https://issues.joomla.org/tracker/joomla-cms/9436
[3]
#9436 (comment)
[4] http://poqueiraweb.com
[5] https://www.gnu.org/licenses/gpl.html

avatar brianteeman brianteeman - change - 16 Mar 2016
Labels Added: ?
avatar wilsonge
wilsonge - comment - 20 Mar 2016

Hey @GeoTimber - know you said you'd be a few days but just wanted to check in and see if you had made any progress on this?

avatar GeoTimber
GeoTimber - comment - 21 Mar 2016

Hi @brianteeman, @wilsonge
I only work on Monday and Tuesday on this, have some other projects going ;), thanks for getting back.

I created a clean install and tested front user creation and could not recreate the problem.

So I investigated my code more and traced it back to a

$user=JFactory::getUser();
$user->name=$newName;
if (!$user->save()) {..}

call I do in the first session ( in a save event of a custom user profile edit screen with the ability to change the users's name )

Here the current logged in user object is retrieved from the session storage and not from the jml_users table in the database
( file/code)
libraries/joomla/factory.php line 236 :

public static function getUser($id = null)
{
$instance = self::getSession()->get('user');

thus the user object from the session storage has the lastvistDate not set YET apparently, and therefore on a save it will be overwritten.

So more or less a fiddle, but nevertheless not exactly the expected behavior in my case.

... I guess the last visit is not set until it is over ;) ...

Hope this helps and that I am right, Joris

avatar brianteeman
brianteeman - comment - 29 Mar 2016

As you have stated that their is no issue in the core code but in your custom code I am closing this


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9436.

avatar brianteeman brianteeman - change - 29 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-29 10:32:05
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 Mar 2016

Add a Comment

Login with GitHub to post a comment