View Single Post
  #3 (permalink)  
Old 04-01-2008, 02:25 PM
davidmpaz davidmpaz is offline
Junior Member
 
Join Date: Mar 2008
Posts: 8
Default

Hello,
I'm facing the same problem, right now. I have this form declaration:

<form name="loginForm" method="post" id="loginForm" action="login/authenticate">

and in my index action for index controller, if user is not authenticated is redirected to login page wich is showing up well, but when I submit the form, in the authenticateAction i'm not able to get the post parameter, this is the code of the action (I've already try the above suggestion) but the same, not autheticated because I get redirected to the same page:

public function authenticateAction()
{
include_once MODELS_HOME.'Factory.php';
$auth = Factory::newInstance(AUTH);
$result = $auth->authenticate(
$this->getRequest()->getPost('username'),
$this->getRequest()->getPost('password')
);

if($result->isValid())
$this->_forward('index', 'index');
else
{
$error = '';
foreach ($result->getMessages() as $message)
{
$error .= $message."\n";
}
$this->_setParam('error', $error);
$this->_forward('login','login');
}
}

Any idea on what's going on,
Thank in advance.
Reply With Quote