EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Login_openidController.php
Go to the documentation of this file.
1 <?php
2 
8 {
9  public function actionIndex()
10  {
11  $this->render('index');
12  }
13 
14 
15  public function actionLogin() {
16  $model = new LoginForm;
17 
18  // if it is ajax validation request
19  if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
20  echo CActiveForm::validate($model);
21  Yii::app()->end();
22  }
23 
24  // collect user input data
25  if (isset($_POST['LoginForm'])) {
26  $model->attributes = $_POST['LoginForm'];
27  // validate user input and redirect to the previous page if valid
28  if ($model->validate() && $model->login())
29  $this->redirect(Yii::app()->user->returnUrl);
30  }
31  // display the login form
32  $this->render('login', array('model' => $model));
33  }
34 
35  // Uncomment the following methods and override them if needed
36  /*
37  public function filters()
38  {
39  // return the filter configuration for this controller, e.g.:
40  return array(
41  'inlineFilterName',
42  array(
43  'class'=>'path.to.FilterClass',
44  'propertyName'=>'propertyValue',
45  ),
46  );
47  }
48 
49  public function actions()
50  {
51  // return external action classes, e.g.:
52  return array(
53  'action1'=>'path.to.ActionClass',
54  'action2'=>array(
55  'class'=>'path.to.AnotherActionClass',
56  'propertyName'=>'propertyValue',
57  ),
58  );
59  }
60  */
61 }