Commit c2b847bb569356d6501a0d9f496315c26050275a
1 parent
9df5bc0a
Import completed
Showing
1 changed file
with
10 additions
and
10 deletions
Show diff stats
backend/controllers/SiteController.php
| 1 | <?php | 1 | <?php |
| 2 | namespace backend\controllers; | 2 | namespace backend\controllers; |
| 3 | - | 3 | + |
| 4 | + use artbox\core\models\LoginForm; | ||
| 4 | use common\models\Settings; | 5 | use common\models\Settings; |
| 5 | use Yii; | 6 | use Yii; |
| 6 | use yii\web\Controller; | 7 | use yii\web\Controller; |
| 7 | use yii\filters\VerbFilter; | 8 | use yii\filters\VerbFilter; |
| 8 | use yii\filters\AccessControl; | 9 | use yii\filters\AccessControl; |
| 9 | - use common\models\LoginForm; | ||
| 10 | - | 10 | + |
| 11 | /** | 11 | /** |
| 12 | * Site controller | 12 | * Site controller |
| 13 | */ | 13 | */ |
| @@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
| 49 | ], | 49 | ], |
| 50 | ]; | 50 | ]; |
| 51 | } | 51 | } |
| 52 | - | 52 | + |
| 53 | /** | 53 | /** |
| 54 | * @inheritdoc | 54 | * @inheritdoc |
| 55 | */ | 55 | */ |
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | ], | 61 | ], |
| 62 | ]; | 62 | ]; |
| 63 | } | 63 | } |
| 64 | - | 64 | + |
| 65 | /** | 65 | /** |
| 66 | * Displays homepage. | 66 | * Displays homepage. |
| 67 | * | 67 | * |
| @@ -70,14 +70,14 @@ | @@ -70,14 +70,14 @@ | ||
| 70 | public function actionIndex() | 70 | public function actionIndex() |
| 71 | { | 71 | { |
| 72 | $settings = Settings::getInstance(); | 72 | $settings = Settings::getInstance(); |
| 73 | - | 73 | + |
| 74 | if (empty( $settings->analytics_key )) { | 74 | if (empty( $settings->analytics_key )) { |
| 75 | return $this->render('instruction'); | 75 | return $this->render('instruction'); |
| 76 | } else { | 76 | } else { |
| 77 | return $this->render('index'); | 77 | return $this->render('index'); |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | - | 80 | + |
| 81 | /** | 81 | /** |
| 82 | * Login action. | 82 | * Login action. |
| 83 | * | 83 | * |
| @@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
| 88 | if (!Yii::$app->user->isGuest) { | 88 | if (!Yii::$app->user->isGuest) { |
| 89 | return $this->goHome(); | 89 | return $this->goHome(); |
| 90 | } | 90 | } |
| 91 | - | 91 | + |
| 92 | $model = new LoginForm(); | 92 | $model = new LoginForm(); |
| 93 | if ($model->load(Yii::$app->request->post()) && $model->login()) { | 93 | if ($model->load(Yii::$app->request->post()) && $model->login()) { |
| 94 | return $this->goBack(); | 94 | return $this->goBack(); |
| @@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
| 101 | ); | 101 | ); |
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | - | 104 | + |
| 105 | /** | 105 | /** |
| 106 | * Logout action. | 106 | * Logout action. |
| 107 | * | 107 | * |
| @@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
| 110 | public function actionLogout() | 110 | public function actionLogout() |
| 111 | { | 111 | { |
| 112 | Yii::$app->user->logout(); | 112 | Yii::$app->user->logout(); |
| 113 | - | 113 | + |
| 114 | return $this->goHome(); | 114 | return $this->goHome(); |
| 115 | } | 115 | } |
| 116 | } | 116 | } |