public function connectAction() { $form = new User_Form_Login(); if( $this->getRequest()->isPost() ) { if( $form->isValid( $this->getRequest()->getPost() ) ){ $user = new User_Model_User(); $user->setLogin($form->getValue('login') ); $user->setPassword($form->getValue('password') ); $userMapper = new User_Model_Mapper_User(); if( $id = $userMapper->login( $user ) ){ $this->addSystemSuccess('connexion'); $this->_redirect( $this->_helper->url->url( array(), 'userList' )); } else { $this->addSystemError('Echec connexion'); } } else { $this->addSystemError('echec connexion'); } } $this->view->form = $form; }