Re: retrieve online status of a user while logged in
remember that this issue should be on demand not every period of time. it is better to do it usin javascript/ajax John Andersen said the truth... the last activity time... but the 5 minutes is something too long... heheh I do like the way On Oct 15, 12:22 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, that sounds nice, I think I'll give it a try and make an example of this. I think most apps use a separate Javascript-Client for these purposes, but I have to look for infos about that a little longer the next few weeks... Regards, DD On 13 Okt., 07:39, John Andersen j.andersen...@gmail.com wrote: Add a last activity time field, and update it whenever the user does something on the site. If the user has not done anything for 5 min, show the usersonlinestatusas away. If the user has not done anything for 10 min, show the usersonlinestatusas offline. If a user has a contact (friend) relationship with another user, and the other user logs in, then using the contact relationship, add a note to the user, that the other user has logged in and delete the note when it has been presented. Best wishes, John On Oct 12, 4:07 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, I need to figure out a solution for a problem. Let's say I have an app which is controlled beiAuthand ACL, so the user can log in into a system and do stuff. Everyone knows from several social networks or chat clients that when a user is logged in, and one or more friends areonline, too, the statusof these users is shown. The question is, how could I do such a thing in Cake? Is there any chance to retriebe thestatusof a user, and flag it so another user (which is his/her friend or so) can see that he's actually online? I think I could use a flag in the user's table like online with 1 or 0 as flag, and set the online-statusto 1 as a user logs in. But if a user does not log out, maybe because he just closes the browser, there is no way to set thestatusback to 0 so an indicator could show the user as offline (which means, that the field online would be set back to 0). I'm very interested in solutions for such problems, so if you have any suggestions, please let me know. Regards, DD- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
Hey, that sounds nice, I think I'll give it a try and make an example of this. I think most apps use a separate Javascript-Client for these purposes, but I have to look for infos about that a little longer the next few weeks... Regards, DD On 13 Okt., 07:39, John Andersen j.andersen...@gmail.com wrote: Add a last activity time field, and update it whenever the user does something on the site. If the user has not done anything for 5 min, show the usersonlinestatusas away. If the user has not done anything for 10 min, show the usersonlinestatusas offline. If a user has a contact (friend) relationship with another user, and the other user logs in, then using the contact relationship, add a note to the user, that the other user has logged in and delete the note when it has been presented. Best wishes, John On Oct 12, 4:07 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, I need to figure out a solution for a problem. Let's say I have an app which is controlled bei Auth and ACL, so the user can log in into a system and do stuff. Everyone knows from several social networks or chat clients that when a user is logged in, and one or more friends areonline, too, the statusof these users is shown. The question is, how could I do such a thing in Cake? Is there any chance to retriebe thestatusof a user, and flag it so another user (which is his/her friend or so) can see that he's actually online? I think I could use a flag in the user's table like online with 1 or 0 as flag, and set the online-statusto 1 as a user logs in. But if a user does not log out, maybe because he just closes the browser, there is no way to set thestatusback to 0 so an indicator could show the user as offline (which means, that the field online would be set back to 0). I'm very interested in solutions for such problems, so if you have any suggestions, please let me know. Regards, DD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
Add a last_login field to users table. In Users:login() do something like: $this-User-id = $this-Auth-user('id'); $this-User-saveField('last_login', date('Y-m-d H:i:s')); Then you can fetch the id, name, etc. of all users whose last_login is within some period of time. There's no bullet-proof way to deal with a person closing their browser but this will at least give an approximate list. On Sun, Oct 11, 2009 at 9:07 PM, DigitalDude e.blumsten...@googlemail.com wrote: Hey, I need to figure out a solution for a problem. Let's say I have an app which is controlled bei Auth and ACL, so the user can log in into a system and do stuff. Everyone knows from several social networks or chat clients that when a user is logged in, and one or more friends are online, too, the status of these users is shown. The question is, how could I do such a thing in Cake? Is there any chance to retriebe the status of a user, and flag it so another user (which is his/her friend or so) can see that he's actually online? I think I could use a flag in the user's table like online with 1 or 0 as flag, and set the online-status to 1 as a user logs in. But if a user does not log out, maybe because he just closes the browser, there is no way to set the status back to 0 so an indicator could show the user as offline (which means, that the field online would be set back to 0). I'm very interested in solutions for such problems, so if you have any suggestions, please let me know. Regards, DD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
Hey, hmm ok this would be a workaround I think. I was more like using a field called is_online, which is 0 when not logged in, when logging in it would be set to 1 and then a javascript function could refresh this field every let's say minute or so. But if the user closes the browser, how would I get to set it back to 0 This one seems to be a little tricky :) Any other suggestions? DD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
On Mon, Oct 12, 2009 at 5:11 PM, DigitalDude e.blumsten...@googlemail.com wrote: Hey, hmm ok this would be a workaround I think. I was more like using a field called is_online, which is 0 when not logged in, when logging in it would be set to 1 and then a javascript function could refresh this field every let's say minute or so. But if the user closes the browser, how would I get to set it back to 0 Which is why relying on a flag is a bad idea. Again: There's no bullet-proof way to deal with a person closing their browser. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
Add a last activity time field, and update it whenever the user does something on the site. If the user has not done anything for 5 min, show the users online status as away. If the user has not done anything for 10 min, show the users online status as offline. If a user has a contact (friend) relationship with another user, and the other user logs in, then using the contact relationship, add a note to the user, that the other user has logged in and delete the note when it has been presented. Best wishes, John On Oct 12, 4:07 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, I need to figure out a solution for a problem. Let's say I have an app which is controlled bei Auth and ACL, so the user can log in into a system and do stuff. Everyone knows from several social networks or chat clients that when a user is logged in, and one or more friends are online, too, the status of these users is shown. The question is, how could I do such a thing in Cake? Is there any chance to retriebe the status of a user, and flag it so another user (which is his/her friend or so) can see that he's actually online? I think I could use a flag in the user's table like online with 1 or 0 as flag, and set the online-status to 1 as a user logs in. But if a user does not log out, maybe because he just closes the browser, there is no way to set the status back to 0 so an indicator could show the user as offline (which means, that the field online would be set back to 0). I'm very interested in solutions for such problems, so if you have any suggestions, please let me know. Regards, DD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---