@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | public function actionIndex() |
| 72 | 72 | { |
| 73 | 73 | $time = Yii::$container->get(\common\interfaces\TimeInterface::class); |
| 74 | - $key = "index_blog_".$time->getLocalDate('UTC'); |
|
| 74 | + $key = "index_blog_" . $time->getLocalDate('UTC'); |
|
| 75 | 75 | $posts = Yii::$app->cache->get($key); |
| 76 | - if($posts === false) { |
|
| 76 | + if ($posts === false) { |
|
| 77 | 77 | $posts = \Yii::$app->getModule('blog') |
| 78 | 78 | ->fetch() |
| 79 | 79 | ->parse() |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $model = new ContactForm(); |
| 108 | 108 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
| 109 | - if($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
| 109 | + if ($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
| 110 | 110 | Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); |
| 111 | 111 | } else { |
| 112 | 112 | Yii::$app->session->setFlash('error', 'There was an error sending email.'); |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | public function actionSignup() |
| 139 | 139 | { |
| 140 | 140 | $model = Yii::$container->get(\site\models\SignupForm::class); |
| 141 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 141 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 142 | 142 | $model->signup(); |
| 143 | 143 | Yii::$app->getSession()->setFlash('success', 'We have sent a verification email to the email address you provided. Please check your inbox and follow the instructions to verify your account.'); |
| 144 | - return $this->redirect('/',302); |
|
| 144 | + return $this->redirect('/', 302); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return $this->render('signup', [ |
@@ -152,10 +152,10 @@ discard block |
||
| 152 | 152 | public function actionRequestPasswordReset() |
| 153 | 153 | { |
| 154 | 154 | $model = Yii::$container->get(\site\models\PasswordResetRequestForm::class); |
| 155 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 156 | - if(!$model->sendEmail()) { |
|
| 155 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 156 | + if (!$model->sendEmail()) { |
|
| 157 | 157 | $ip = Yii::$app->getRequest()->getUserIP() ?: "UNKNOWN"; |
| 158 | - Yii::warning("$ip has tried to reset the password for ".$model->email); |
|
| 158 | + Yii::warning("$ip has tried to reset the password for " . $model->email); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | Yii::$app->getSession()->setFlash('success', 'If there is an account with the submitted email address you will receive further instructions in your email inbox.'); |
@@ -198,14 +198,14 @@ discard block |
||
| 198 | 198 | throw new BadRequestHttpException("Wrong or expired email verification token. If you aren't sure why this error occurs perhaps you've already verified your account. Please try logging in."); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if($user->isTokenConfirmed($user->verify_email_token)) { |
|
| 201 | + if ($user->isTokenConfirmed($user->verify_email_token)) { |
|
| 202 | 202 | Yii::$app->getSession()->setFlash('success', 'Your account has already been verified. Please log in.'); |
| 203 | - return $this->redirect('/login',302); |
|
| 203 | + return $this->redirect('/login', 302); |
|
| 204 | 204 | } else if (Yii::$app->getUser()->login($user)) { |
| 205 | 205 | $user->confirmVerifyEmailToken(); |
| 206 | 206 | $user->save(); |
| 207 | 207 | Yii::$app->getSession()->setFlash('success', 'Your account has been verified. Please continue with your check-in.'); |
| 208 | - return $this->redirect('/welcome',302); |
|
| 208 | + return $this->redirect('/welcome', 302); |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | public function actionExport() |
| 223 | 223 | { |
| 224 | 224 | header("Content-Type: text/csv"); |
| 225 | - header("Content-Disposition: attachment; filename=fsa-data-export-".Yii::$app->user->identity->email."-".date('Ymd').".csv"); |
|
| 225 | + header("Content-Disposition: attachment; filename=fsa-data-export-" . Yii::$app->user->identity->email . "-" . date('Ymd') . ".csv"); |
|
| 226 | 226 | |
| 227 | 227 | $reader = Yii::$app->user->identity->getExportData(); |
| 228 | 228 | $fp = fopen('php://output', 'w'); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | fputcsv($fp, $header); |
| 240 | 240 | $user_behavior = Yii::$container->get(\common\interfaces\UserBehaviorInterface::class); |
| 241 | - while($row = $reader->read()) { |
|
| 241 | + while ($row = $reader->read()) { |
|
| 242 | 242 | $row = $user_behavior::decorateWithCategory([$row]); |
| 243 | 243 | $row = Yii::$app->user->identity->cleanExportData($row); |
| 244 | 244 | fputcsv($fp, $row[0]); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | if ($editProfileForm->load(Yii::$app->request->post())) { |
| 69 | 69 | $saved_user = $editProfileForm->saveProfile(); |
| 70 | - if($saved_user) { |
|
| 70 | + if ($saved_user) { |
|
| 71 | 71 | Yii::$app->getSession()->setFlash('success', 'New profile data saved!'); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $model = Yii::$container->get(\site\models\DeleteAccountForm::class, [Yii::$app->user->identity]); |
| 86 | 86 | |
| 87 | 87 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
| 88 | - if($model->deleteAccount()) { |
|
| 88 | + if ($model->deleteAccount()) { |
|
| 89 | 89 | $this->redirect(['site/index']); |
| 90 | 90 | } else { |
| 91 | 91 | Yii::$app->getSession()->setFlash('error', 'Wrong password!'); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $model = Yii::$container->get(\site\models\ChangePasswordForm::class, [Yii::$app->user->identity]); |
| 101 | 101 | |
| 102 | 102 | if ($model->load(Yii::$app->request->post())) { |
| 103 | - if($model->validate() && $model->changePassword()) { |
|
| 103 | + if ($model->validate() && $model->changePassword()) { |
|
| 104 | 104 | Yii::$app->getSession()->setFlash('success', 'Password successfully changed'); |
| 105 | 105 | } else { |
| 106 | 106 | Yii::$app->getSession()->setFlash('error', 'Wrong password!'); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public function actionExport() |
| 114 | 114 | { |
| 115 | 115 | header("Content-Type: text/csv"); |
| 116 | - header("Content-Disposition: attachment; filename=fsa-data-export-".Yii::$app->user->identity->email."-".date('Ymd').".csv"); |
|
| 116 | + header("Content-Disposition: attachment; filename=fsa-data-export-" . Yii::$app->user->identity->email . "-" . date('Ymd') . ".csv"); |
|
| 117 | 117 | |
| 118 | 118 | $reader = Yii::$app->user->identity->getExportData(); |
| 119 | 119 | $fp = fopen('php://output', 'w'); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | fputcsv($fp, $header); |
| 131 | 131 | $user_behavior = Yii::$container->get(\common\interfaces\UserBehaviorInterface::class); |
| 132 | - while($row = $reader->read()) { |
|
| 132 | + while ($row = $reader->read()) { |
|
| 133 | 133 | $row = $user_behavior::decorateWithCategory([$row]); |
| 134 | 134 | $row = Yii::$app->user->identity->cleanExportData($row); |
| 135 | 135 | fputcsv($fp, $row[0]); |