|
|
@ -17,10 +17,10 @@ class SiteController extends Controller |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
'access' => [ |
|
|
|
'access' => [ |
|
|
|
'class' => \yii\web\AccessControl::className(), |
|
|
|
'class' => \yii\web\AccessControl::className(), |
|
|
|
'only' => ['login', 'logout', 'signup'], |
|
|
|
'only' => ['logout', 'signup'], |
|
|
|
'rules' => [ |
|
|
|
'rules' => [ |
|
|
|
[ |
|
|
|
[ |
|
|
|
'actions' => ['login', 'signup'], |
|
|
|
'actions' => ['signup'], |
|
|
|
'allow' => true, |
|
|
|
'allow' => true, |
|
|
|
'roles' => ['?'], |
|
|
|
'roles' => ['?'], |
|
|
|
], |
|
|
|
], |
|
|
@ -54,6 +54,10 @@ class SiteController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function actionLogin() |
|
|
|
public function actionLogin() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!\Yii::$app->user->isGuest) { |
|
|
|
|
|
|
|
$this->goHome(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$model = new LoginForm(); |
|
|
|
$model = new LoginForm(); |
|
|
|
if ($model->load($_POST) && $model->login()) { |
|
|
|
if ($model->load($_POST) && $model->login()) { |
|
|
|
return $this->goHome(); |
|
|
|
return $this->goHome(); |
|
|
|