Bonjour,

j'ai un formulaire d'authentification qui contient un login et mot de passe ,j'ai reçu une erreur échec de l'identification:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class Admin_IndexController extends Zend_Controller_Action
{
    private $_form;
    public function init()
    {
        /**
         * Init Controller with layout
         */
        $this->_helper->layout->setLayout('login');
        /**
         * Create form to log administrator
         */
        $this->_form = new Admin_Forms_IdentificationAdmin();
        $this->view->form = $this->_form;
    }
 
    public function indexAction()
    {
       if($this->_request->isPost())
       {
               $formLoginAdmin = $this->getRequest()->getPost();
               if($this->_form->isValid($formLoginAdmin))
               {
                   if(empty($formLoginAdmin['loginAd']) || empty($formLoginAdmin['password']) )
                {                        
                    echo json_encode(array(
                        'valid' => false,
                        'error' => "Erreur dans les identifiants"
                    ));
                    exit();
                } 
 
                /**
                 * User method static loginByEmail
                 * 
                 */
                if(Admin_Models_UserTools::loginByEmail($formLoginAdmin['loginAd'], $formLoginAdmin['password']))
                {
                    if(intval(Admin_Models_UserTools::getRankByEmailUser($formLoginAdmin['loginAd'])->rankUser) == Admin_Models_UserTools::LEVEL_ADMINISTRATOR
                        || intval(Admin_Models_UserTools::getRankByEmailUser($formLoginAdmin['loginAd'])->rankUser) == Admin_Models_UserTools::LEVEL_SUPER_ADMINISTRATOR)
                    {
                        echo json_encode(array(
                            'valid' => true,
                            'redirect' => 'general'
                        ));
                        exit();
                    }else{
                        echo json_encode(array(
                            'valid' => false,
                            'error' => "Vous n'avez pas les droits d'accès"
                        ));
                        exit();
                    }
                }                
                echo json_encode(array(
                    'valid' => false,
                    'error' => "Echec de l'identification"
                ));
                exit();                
               }else{
                echo json_encode(array(
                    'valid' => false,
                    'error' => "Le formulaire n'est pas valide"
                ));
                exit();
            }
       }
    }
}
 
Ajoutez [lang=php|phtml|javascript|sql|perl|xml|shell|html
Merci de votre aide