Identifying the moment of successful login using AuthComponent
How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
I added the this functionality to one of my plugins: http://github.com/milesj/forum/blob/master/controllers/users_controller.php#L114 On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
Thanks. I am just a Cake novice--should I infer that there is no solution to my problem that uses AuthComponent as-is? I'm guessing I could modify a few lines in AuthComponent to add a callback, and get the behavior I want--but I'd rather not go down that road if there are simpler options. On Feb 2, 1:30 pm, Miles J mileswjohn...@gmail.com wrote: I added the this functionality to one of my plugins: http://github.com/milesj/forum/blob/master/controllers/users_controll... On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
I just presented you with the solution. You check if Auth has been set within login() then do your database updates. On Feb 2, 1:57 pm, Johnny Cupcake sparklew...@hotmail.com wrote: Thanks. I am just a Cake novice--should I infer that there is no solution to my problem that uses AuthComponent as-is? I'm guessing I could modify a few lines in AuthComponent to add a callback, and get the behavior I want--but I'd rather not go down that road if there are simpler options. On Feb 2, 1:30 pm, Miles J mileswjohn...@gmail.com wrote: I added the this functionality to one of my plugins: http://github.com/milesj/forum/blob/master/controllers/users_controll... On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
On 2 feb, 22:57, Johnny Cupcake sparklew...@hotmail.com wrote: Thanks. I am just a Cake novice--should I infer that there is no solution to my problem that uses AuthComponent as-is? I'm guessing I could modify a few lines in AuthComponent to add a callback, and get the behavior I want--but I'd rather not go down that road if there are simpler options. http://book.cakephp.org/search/Auth%20autoRedirect Regards, AD Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
On 2 feb, 22:22, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. PS if there's no identified user in beforeFilter and there is in the login function - they just logged in. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: Identifying the moment of successful login using AuthComponent
Nevermind, the book does cover this situation. http://book.cakephp.org/view/248/AuthComponent-Variables#autoRedirect-395 The key to the puzzle is understanding that when your login() executes, your form contents have _already_ been processed by AuthComponent...so the login event condition is when (FORM_NOT_EMPTY CREDENTIALS_NOT_ALREADY_REJECTED). I swear, I did read the docs before I asked in the first place ;) On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know whether the login _just occurred_, or it happened five minutes ago! Ideas are greatly appreciated. Please note, I am NOT asking how to determine whether the user logged in _at some point_ in the recent past. I want to map the event itself. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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