|
|
@ -13,43 +13,43 @@ class SiteController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
public function behaviors() |
|
|
|
public function behaviors() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return array( |
|
|
|
return [ |
|
|
|
'access' => array( |
|
|
|
'access' => [ |
|
|
|
'class' => AccessControl::className(), |
|
|
|
'class' => AccessControl::className(), |
|
|
|
'only' => array('login', 'logout'), |
|
|
|
'only' => ['login', 'logout'], |
|
|
|
'rules' => array( |
|
|
|
'rules' => [ |
|
|
|
array( |
|
|
|
[ |
|
|
|
'actions' => array('login'), |
|
|
|
'actions' => ['login'], |
|
|
|
'allow' => true, |
|
|
|
'allow' => true, |
|
|
|
'roles' => array('?'), |
|
|
|
'roles' => ['?'], |
|
|
|
), |
|
|
|
], |
|
|
|
array( |
|
|
|
[ |
|
|
|
'actions' => array('logout'), |
|
|
|
'actions' => ['logout'], |
|
|
|
'allow' => true, |
|
|
|
'allow' => true, |
|
|
|
'roles' => array('@'), |
|
|
|
'roles' => ['@'], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
'verbs' => array( |
|
|
|
'verbs' => [ |
|
|
|
'class' => VerbFilter::className(), |
|
|
|
'class' => VerbFilter::className(), |
|
|
|
'actions' => array( |
|
|
|
'actions' => [ |
|
|
|
'logout' => array('post'), |
|
|
|
'logout' => ['post'], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function actions() |
|
|
|
public function actions() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return array( |
|
|
|
return [ |
|
|
|
'error' => array( |
|
|
|
'error' => [ |
|
|
|
'class' => 'yii\web\ErrorAction', |
|
|
|
'class' => 'yii\web\ErrorAction', |
|
|
|
), |
|
|
|
], |
|
|
|
'captcha' => array( |
|
|
|
'captcha' => [ |
|
|
|
'class' => 'yii\captcha\CaptchaAction', |
|
|
|
'class' => 'yii\captcha\CaptchaAction', |
|
|
|
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, |
|
|
|
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function actionIndex() |
|
|
|
public function actionIndex() |
|
|
@ -63,9 +63,9 @@ class SiteController extends Controller |
|
|
|
if ($model->load($_POST) && $model->login()) { |
|
|
|
if ($model->load($_POST) && $model->login()) { |
|
|
|
return $this->goBack(); |
|
|
|
return $this->goBack(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return $this->render('login', array( |
|
|
|
return $this->render('login', [ |
|
|
|
'model' => $model, |
|
|
|
'model' => $model, |
|
|
|
)); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -82,9 +82,9 @@ class SiteController extends Controller |
|
|
|
Yii::$app->session->setFlash('contactFormSubmitted'); |
|
|
|
Yii::$app->session->setFlash('contactFormSubmitted'); |
|
|
|
return $this->refresh(); |
|
|
|
return $this->refresh(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return $this->render('contact', array( |
|
|
|
return $this->render('contact', [ |
|
|
|
'model' => $model, |
|
|
|
'model' => $model, |
|
|
|
)); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|