Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. public function actionIndex()
  2.     {
  3.         $this->layout = 'nosignin';
  4.         $model = new LoginForm();
  5.         if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
  6.         {
  7.             echo CActiveForm::validate($model);
  8.             Yii::app()->end();
  9.         }
  10.         if(isset($_POST["LoginForm"]))
  11.         {
  12.             $model->username = $_POST["LoginForm"]["username"];
  13.             $model->password = $_POST["LoginForm"]["password"];
  14.  
  15.  
  16.  
  17.             // collect user input data
  18.  
  19.             $model->scenario = 'login';
  20.             $model->username = $_POST["LoginForm"]["username"];
  21.             $model->password = $_POST["LoginForm"]["password"];
  22.             $model->rememberMe = $_POST["LoginForm"]["password"];
  23.             if($model->validate() && $model->login())
  24.             {
  25.                 Yii::app()->controller->redirect(array('/home'));
  26.             }
  27.            
  28.             // display the login form
  29.  
  30.         }
  31.  
  32.  
  33.         $this->render('index',array('model'=>$model));
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement