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