خرید بک لینک

Vote count: 0

Since I use Cakephp, I used Mysql with Cakephp conventions (Users table with useame and password fields).

For some reason, I have to use Postgres database with loginutil instead of useame and mdputil instead of password. And I use a table named Utilisateur.

Here is the code I put in AppController.php for Auth component :

$this->loadComponent('Auth', [
        'authenticate' => [
            'Form' => [
                'fields' => [
                    'useame' => 'loginutil',
                    'password' => 'mdputil'
                ],
                'userModel' => 'Utilisateur'
            ]
        ],
        'loginAction' => [
            'controller' => 'Utilisateur',
            'action' => 'login'
        ]
    ]);

In login.ctp I have two input :

$this->Form->input('loginutil');
$this->Form->input('mdputil');

The login method in my UtilisateurController.php is the default one with $user = $this->Auth->identify();

But when I try to login me, $user is false. The user is not found.

Did I make a mistake somewhere in my code, or maybe I didn't correctly read the doc ?

Thanks for your help.

asked 51 secs ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: شنبه 15 اسفند 1394 ساعت: 14:41

صفحه بندی