Hi guys!
I find a problem in auth component.

*User Model:*
class User extends AppModel {
    var $name = 'User';
}


*Users Controller:*
class UsersController extends AppController {
    var $name = "Users";
    var $uses = array('User');
    var $components = array('Auth');

    function beforeFilter() {
        parent::debugVar($_POST);
        parent::beforeFilter();
    }

    function login() {
        //Auth Magic
        parent::debugVar($this->data);
    }

    function logout() {
        $this->redirect($this->Auth->logout());
    }
}


*App Controller:*
class AppController extends Controller {
    var $components = array('Auth');

    function beforeFilter() {
        //Security::setHash('md5'); // or sha1 or sha256.
        //Configure AuthComponent
        $this->Auth->loginAction = array('controller' => 'users', 'action'
=> 'login');
        $this->Auth->logoutRedirect = array('controller' => 'users',
'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'usuarios',
'action' => 'add');
    }
}


When I run the debug, the sql is mounted correctly. but it returned the
error "Login failed. Invalid username or password."
I take the sql generated and run on the bank, and is returned correctly the
User.
If I print the $ _POST values come correctly, if I print the $ this-> data,
the User is correct, but the password is NULL..


*POST:*
array(2) {
["_method"]=>
string(4) "POST"
["data"]=>
array(1) {
    ["User"]=>
    array(2) {
      ["username"]=>
      string(5) "admin"
      ["password"]=>
      string(6) "123456"
    }
}
}


*this->data:*
array(1) {
["User"]=>
array(2) {
["username"]=>
string(5) "admin"
["password"]=>
NULL
}
}


Does anyone have any idea how to solve this problem?
Thanks friends!

---
Wladiston MaurĂ­cio de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to