Re: logged in users list

2009-08-24 Thread buzachis.a...@gmail.com

Hey,

I do the following thing to get all logged in users in my app:
- column lastActivity;
- in AppController, beforeRender I update that field with current
timestamp;
- then take from DB the users which did an action in the last 60
seconds or so (you choose a timeout).

(this is crappy I think, you do an update (on a possible large table -
depending on your app) each time an user does something; but it's the
most 'direct' solution... and classy also)


On Aug 24, 7:42 am, Junaed Halim  wrote:
> Thank you all for your reply. I'll get the logged-in users by adding a
> datetime column and updating it.
> But how would I know whether someone has logged out or not?
> They can simply close the browser without logging out themselves.
> Am I missing something?
>
> On Mon, Aug 24, 2009 at 8:50 AM, Miles J  wrote:
>
> > You would need a datetime column named "lastLoginTime" or something
> > equivalent.
>
> > Then you would update that with the current timestamp each login.
>
> > Then you would find all users that have logged in within the past x
> > minutes.
>
> --
> Junaed Bin Halim
> Member, R & D Group
> Commlink Info Tech Ltd.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auto-model association doesn't work

2009-08-20 Thread buzachis.a...@gmail.com

Hey everyone.

I have 2 models: User (hasOne) Character (belongsTo) User.

Everything works great on my laptop. When I move it to a server,
somehow, it can't find associations in models. If I do a find('first',
condition id) i get only the User (not the Character too, and YES it
exists in DB), even if I do $this->User->recursive = 1,2... or add
'recursiove' in find options.

If before the find I manualy bindModel them it works (but I don't want
to do this stuff for all my associations). Somehow cake is ignoring my
associations in model files on the other machine and I don't
understand why.

Database exactly the same on both servers, php 5+ on both.

Maybe there is something simple that I'm missing.

Thank you,
Buzachis Aris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---