Powered by Invision Power Board



  Reply to this topicStart new topicStart Poll

> AUTH 2.1, How to set the database fields?
heohni
  Posted: Feb 28 2012, 10:03 PM
Quote Post


Newbie
*

Group: Members
Posts: 9
Member No.: 3115
Joined: 24-August 11



Hi,

what is in cake 2.1 correct?
CODE
$this->Auth->fields = array('username' => 'email', 'password' => 'secretpass');

or
CODE
$this->Auth->authenticate = array('Form' => array('username' => 'email', 'password' => 'secretpass'));


has no effect to my script.

I call on my users controller
CODE
var $components = array('Auth');


as long as my db fields are 'username' and 'password' all fine...

but when they have different names, it wont work, as both declarations are getting ignored.

CODE
var $components = array('Auth' =>  array(
                 'authenticate' =>  array(
                     'Form' =>  array(
                         "fields" =>  array(
                             'username' =>  'usr_username',
                             'password' =>  'usr_password'
                         ),
                     )
                )));


Only returns me a login failed from the }else{ of if ($this->Auth->login()) {
But no error at all!

So I am lost here!
Who is using Cake 2.1 and has AUTH working with different db fields?
Please say hello!!
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Disclaimer:
This forum is in no way affiliated with the Cake Software Foundation
The CakePHP name and icon is a trademark of the Cake Software Foundation


Lo-Fi Version