I am trying to authenticate the login, and the username makes it to the user
controller, but for some reason, the passord is empty.
In the before filter of the app controller, everything is there, but when I
look at the data in the login function, the password is blank. Any ideas?
Here is the before filter in the app controller:
function beforeFilter(){
$this->Auth->loginRedirect = array('controller' => 'users', 'action'
=> 'home');
$this->Auth->logoutRedirect = array('controller' => 'users',
'action' => 'home');
$this->Auth->allow('signup', 'confirm', 'show', 'home');
$this->Auth->authorize = 'controller';
$this->Auth->userScope = array('User.confirmed' => '1');
$this->set('loggedIn', $this->Auth->user('id'));
$this->Auth->autoRedirect = false;
$this->Cookie->name = 'Authorization';
if(!$this->Auth->user('id')) {
$cookie = $this->Cookie->read('User');
if($cookie) {
$this->Auth->login($cookie);
}
}
debug($this->data);
}
Here is the code for the user controller:
function login()
{
debug($this->data);
if($this->Auth->User())
{
if(!empty($this->data))
{
if(empty($this->data['User']['remember_me']))
{
debug('Deleting Cookie');
$this->Cookie->del('User');
}
else
{
debug('Loading From Cookie');
$cookie = array();
$cookie['username'] = $this->data['User']['username'];
$cookie['password'] = $this->data['User']['password'];
$this->Cookie->write('User', $cookie, true, '+2 weeks');
}
unset($this->data['User']['remember_me']);
}
$this->redirect($this->Auth->redirect());
}
}
Here is the debug info of the data.
*app\app_controller.php* (line *29*)
Array
(
[User] => Array
(
[username] => test
[password] => kww
[remember_me] => 0
)
)
*app\controllers\users_controller.php* (line *16*)
Array
(
[User] => Array
(
[username] => test
[password] =>
[remember_me] => 0
)
)
Any ideas? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---