Exemplo n.º 1
0
 public function loginAction()
 {
     $this->_helper->layout->setLayout('layout_login');
     $form = new Application_Form_Login();
     $params = $this->_request->getParams();
     if ($this->_request->isPost() && $form->isValid($params)) {
         $_usuario = new Application_Model_Usuario();
         $loginValido = $_usuario->autenticar($form->getValues());
         if ($loginValido) {
             $this->_redirect('/');
         } else {
             $this->_helper->FlashMessenger('Usuario o contraseña invalido');
             $this->_redirect('/index/login');
         }
     }
     $this->view->form = $form;
 }