Si quite la parte de la redirección. En el controlador.
Código PHP:
Ver originalclass SecurityController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action index
}
public function loginAction()
{
$request = $this->getRequest();
if (!$request->isPost()) {
return $this->_helper->redirector('index','index');
}
$form = new Application_Form_LoginForm();
if(!$form->isValid($request->getPost())) {
$this->view->form = $form;
$this->renderScript('index/index.phtml');
return;
}
$modelSecurity = new Application_Model_Security();
$username = $this->_getParam('username');
$password = $this->_getParam('password');
if($modelSecurity->validarUsuario($username, $password)):
return $this->_helper->redirector(index, user);
endif;
return $this->_helper->redirector('index','index');
}
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
$this->_helper->redirector('index','index'); // back to login page
}
}