How to known user status (login OR logout)

66 views
Skip to first unread message

Sergey Zhuravlov

unread,
Mar 15, 2013, 12:34:37 AM3/15/13
to Fat Free CRM Users
Hi

Does anybody know how to derermine whether a user is logged in the
system?
For this we use a database query?

Required for integration with IP PBX.

Thanks

Steve Kenworthy

unread,
Mar 19, 2013, 5:21:20 AM3/19/13
to fat-free-...@googlegroups.com
During a request in rails, the 'current_user' variable is available to tell you who the current user is.

If you have an external system and are wanting to know if a user is logged in, you could query the Users table. There are a few columns that might be of interest:

* last_login_at
* last_request_at

These return timestamp values (in postgres at least).

Regards,
Steve


--
You received this message because you are subscribed to the Google Groups "Fat Free CRM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fat-free-crm-us...@googlegroups.com.
To post to this group, send email to fat-free-...@googlegroups.com.
Visit this group at http://groups.google.com/group/fat-free-crm-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Sergey Zhuravlov

unread,
Mar 20, 2013, 3:20:23 AM3/20/13
to Fat Free CRM Users
Yes I need to know when the case of the third-party system, and learn
best by a database query.

Is it possible to date the last login to the system to find out
whether the user NOW?

Similarly to the last request?

Or any requests made ​​permanent, if a user in the system?

If so, this will do.


Thank you!

Steve Kenworthy

unread,
Mar 20, 2013, 4:43:42 AM3/20/13
to fat-free-...@googlegroups.com
I think the closest you can get is "last_request_at" which would be the last time the user clicked a link that fired off a request to the server.

It's a hard question to answer on any web based system without connecting the server and client in some form of live polling.

Regards,
Steve

Sergey Zhuravlov

unread,
Mar 20, 2013, 1:21:05 PM3/20/13
to Fat Free CRM Users

After logging in actually changing the value "last_request_at"
However, if the user is in the system, but not make any action with
values ​​nothing more happens
Only when the user logs out again updated "last_request_at"

So more or less accurately establish whether the logged user is not
it?
Reply all
Reply to author
Forward
0 new messages