Re: Auth Component CakePHP 2.0
Hi Ahmed, thanks a lot for your help. My array looks like this now, but it doesn't work better. public $components = array( 'Acl', 'Auth' = array( 'authorize' = array( 'Actions' = array('actionPath' = 'controllers') ), 'authenticate ' = array( 'Form' = array( 'Fields' = array( 'username' = 'email_address', 'password' = 'password' ) ) ) ), 'Session' ); I'm still being kicked when I try to log in. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Auth Component CakePHP 2.0
It actually worked with 'fields'. thanks for your help :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Auth Component CakePHP 2.0
Hello, you may try to Fields variable in Auth array. instead of : 'authentificate' = array( 'Form' = array( 'username' = 'email_address', 'password' = 'password' ) ) try this: 'authentificate' = array( 'Form' = array( 'Fields' = array( 'username' = 'email_address', 'password' = 'password' ) ) ) Thanks -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Auth Component CakePHP 2.0
one more correction, it's authenticate not authentificate. good luck -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Auth Component CakePHP 2.0
Hi everyone, I started to learn CakePHP recently and followed the ACL tutorial step by step, trying to understand every single piece of it. Sadly, I couldn't achieve it correctly since my app doesn't work. Indeed, I can't log in. Every time, it says that my user name or password is incorrect (while it should be correct). I don't login with User.username and User.password but with User.email_address and User.password. Therefore my AppController: public $components = array( 'Acl', 'Auth' = array( 'authorize' = array( 'Actions' = array('actionPath' = 'controllers') ), 'authentificate' = array( 'Form' = array( 'username' = 'email_address', 'password' = 'password' ) ) ), 'Session' ); And in my UsersController: public function login() { if ($this-Session-read('Auth.User')) { $this-Session-setFlash('You are logged in!'); $this-redirect('/', null, false); } if ($this-request-is('post')) { if ($this-Auth-login()) $this-redirect($this-Auth-redirect()); else $this-Session-setFlash('Your email address or password was incorrect.'); } } I'm being careful and my password is encrypted in MD5 in my User model public function beforeSave() { $this-data['User']['password'] = AuthComponent::password($this- data['User']['password']); return true; } If always ends in Your email address or password was incorrect. and I can't figure out what I did wrong. It's frustrating, I find the tutorial very abstruse on some important points as I'd like to understand how it works. Thank you in advance for your help. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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