|
|
@ -26,8 +26,8 @@ class SiteController extends Controller |
|
|
|
public function actionLogin() |
|
|
|
public function actionLogin() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$model = new LoginForm(); |
|
|
|
$model = new LoginForm(); |
|
|
|
if ($this->populate($_POST, $model) && $model->login()) { |
|
|
|
if ($model->load($_POST) && $model->login()) { |
|
|
|
return Yii::$app->response->redirect(array('site/index')); |
|
|
|
return $this->redirect(array('site/index')); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return $this->render('login', array( |
|
|
|
return $this->render('login', array( |
|
|
|
'model' => $model, |
|
|
|
'model' => $model, |
|
|
@ -38,15 +38,15 @@ class SiteController extends Controller |
|
|
|
public function actionLogout() |
|
|
|
public function actionLogout() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Yii::$app->user->logout(); |
|
|
|
Yii::$app->user->logout(); |
|
|
|
return Yii::$app->response->redirect(array('site/index')); |
|
|
|
return $this->redirect(array('site/index')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function actionContact() |
|
|
|
public function actionContact() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$model = new ContactForm; |
|
|
|
$model = new ContactForm; |
|
|
|
if ($this->populate($_POST, $model) && $model->contact(Yii::$app->params['adminEmail'])) { |
|
|
|
if ($model->load($_POST) && $model->contact(Yii::$app->params['adminEmail'])) { |
|
|
|
Yii::$app->session->setFlash('contactFormSubmitted'); |
|
|
|
Yii::$app->session->setFlash('contactFormSubmitted'); |
|
|
|
return Yii::$app->response->refresh(); |
|
|
|
return $this->refresh(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return $this->render('contact', array( |
|
|
|
return $this->render('contact', array( |
|
|
|
'model' => $model, |
|
|
|
'model' => $model, |
|
|
|