Hello,
I recently inherited a Yii based project at work and I have been tasked with adding several new features. This is the first time I have worked with Yii and I seem to have gotten myself stuck.
One of the features that I need to add is a browser validation page. The idea of this page is if you attempt to use the app with an unsupported browser you will be directed to a page that tells you that performance might be less than optimal you then have the option of following a link to a supported browsers page or continuing anyway.
This is the code I used to determine which page to load initially:
if($this->browserCheck()){
if (!Yii::app()->user->isGuest)
{
$this->redirect(array('confirm'));
}
$model=new LoginForm;
if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
if ($model->validate() && $model->login())
{
$this->redirect(array('confirm'));
}
}
header("Content-type: text/html", true, 203);
$this->render('login',array('model'=>$model));
}else{
$model = new LoginForm;
$this->render('browser',array('model'=>$model));
}
My problem is if a user has an unsupported browser and they get directed to the page that tells them so, I dont know how to implement a "continue anyway button" that would render the login page for them.
Am I going about this totally wrong? Is there a better solution? Any help would be appreciated.
Thanks