I have a login portlet up and running that's based on this tutorial. It works just fine, however, if there is an error with the login form the error messages are displayed within the portlet and they aren't very prominent.
The portlet follows:
class UserLogin extends Portlet
{
public $title='Login';
protected function renderContent()
{
$form=new LoginForm;
if(isset($_POST['LoginForm']))
{
$form->attributes=$_POST['LoginForm'];
if($form->validate())
$this->controller->refresh();
}
$this->render('userLogin',array('form'=>$form));
}
}
I would prefer any error to cause the login attempt to redirect to a full login form where the errors can be displayed prominently and it will be clear to the user something has gone wrong.
Something along the lines of:
if($form->validate())
$this->controller->refresh();
else
$this->render('login',array('form'=>$form));
The else bit isn't correct, however, and I can't seem to figure out how to make it happen.