Re: How to to something after successful login (like callback) ?
seehttp://book.cakephp.org/view/395/autoRedirect regards, AD oh much thanks. i wonder why I never saw that. But now it works, wonderful thanks --~--~-~--~~~---~--~~ 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: How to to something after successful login (like callback) ?
UsersController: // this is the stripped-down version public function login() { if ($user = $this-Auth-user()) { $this-User-Login-create(); $this-User-Login-save( array( 'Login' = array( 'user_id' = $user['User']['id'] ) ) ); } } that won't work for me, i don't know why. first I inserted your IF with the db update, but nothing happend. then I tested the IF: if ($user = $this-Auth-user()) { exit(); } but no effects. --~--~-~--~~~---~--~~ 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: How to to something after successful login (like callback) ?
On Jun 21, 7:15 pm, u2ix demian.gempe...@gmail.com wrote: UsersController: // this is the stripped-down version public function login() { if ($user = $this-Auth-user()) { $this-User-Login-create(); $this-User-Login-save( array( 'Login' = array( 'user_id' = $user['User']['id'] ) ) ); } } that won't work for me, i don't know why. first I inserted your IF with the db update, but nothing happend. then I tested the IF: if ($user = $this-Auth-user()) { exit(); } but no effects. see http://book.cakephp.org/view/395/autoRedirect regards, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to to something after successful login (like callback) ?
Hello I want to update a field in database (loginCount) after successful login. But I found now way where to insert this action, without to make a redirect, as a callback or similar. If I insert it in Users/login it will only be executed on getting the login page, as I see? How can I do this? Thanks for help --~--~-~--~~~---~--~~ 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: How to to something after successful login (like callback) ?
On Fri, Jun 19, 2009 at 11:12 AM, u2ixdemian.gempe...@gmail.com wrote: Hello I want to update a field in database (loginCount) after successful login. But I found now way where to insert this action, without to make a redirect, as a callback or similar. If I insert it in Users/login it will only be executed on getting the login page, as I see? You should be able to do this inside login(). Can you post your code? I'm doing something similar, except that the logins are saved to a separate table. This way, I can keep a record of dates/times. CREATE TABLE IF NOT EXISTS logins ( id INT(10) UNSIGNED NOT NULL auto_increment PRIMARY KEY, created DATETIME DEFAULT NULL, user_id INT(10) UNSIGNED NOT NULL, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ) ENGINE=MyISAM class Login extends AppModel { public $belongsTo = array('User'); } public $hasMany = array( 'Login' = array( 'className' = 'Login', 'foreignKey' = 'user_id', 'dependent' = true ) ); UsersController: // this is the stripped-down version public function login() { if ($user = $this-Auth-user()) { $this-User-Login-create(); $this-User-Login-save( array( 'Login' = array( 'user_id' = $user['User']['id'] ) ) ); } } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---