Hi Guys,
Got a strange issue here, it’s probably something obvious but I can’t see it right now.
When debug is on my login action works 100%. (
defined('YII_DEBUG') or define('YII_DEBUG',true);
)
As soon as I turn debugging off the login page displays an error when the form is submitted, as follows:
CHttpException
Unable to resolve the request "site/error".
My login action is pretty standard:
public function actionIndex()
{
if(Yii::app()->user->isGuest)
{
$model=new LoginForm;
// collect user input data
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
echo Yii::app()->user->returnUrl;
if($model->validate() && $model->login()){
$this->redirect(Yii::app()->user->returnUrl);
}
}
// display the login form
$this->render('index',array('model'=>$model));
}else{
// display already logged in notice
$this->render('loggedin');
}
}
Has anyone seen anything like this before, any ideas?
Thanks for your time.