Monday, May 31, 2010

CakePHP - Auth

Hi

I am using the following code to authenticate a user:


function beforeFilter() {
$this->Auth->fields = array('username' => 'email',
'password' => 'password');

}

Its working fine! But, I want cakephp to validate the auth with
username = 'email' OR username = 'username'

I tried the following but its not working:


function beforeFilter() {
$this->Auth->fields = array('username' =>
array('email','username'), 'password' => 'password');

}

Can anyone help me with this pls?


Many Thanks

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: