@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | 'allow' => true, |
| 28 | 28 | 'roles' => ['@'], |
| 29 | 29 | ], [ |
| 30 | - 'actions' => [ 'change-email', ], |
|
| 30 | + 'actions' => ['change-email', ], |
|
| 31 | 31 | 'allow' => true, |
| 32 | 32 | ], |
| 33 | 33 | ], |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($editProfileForm->load(Yii::$app->request->post())) { |
| 74 | 74 | $saved_user = $editProfileForm->saveProfile(); |
| 75 | - if($saved_user) { |
|
| 75 | + if ($saved_user) { |
|
| 76 | 76 | Yii::$app->getSession()->setFlash('success', 'New profile data saved!'); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $model = Yii::$container->get(\site\models\DeleteAccountForm::class, [Yii::$app->user->identity]); |
| 91 | 91 | |
| 92 | 92 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
| 93 | - if($model->deleteAccount()) { |
|
| 93 | + if ($model->deleteAccount()) { |
|
| 94 | 94 | $this->redirect(['site/index']); |
| 95 | 95 | } else { |
| 96 | 96 | Yii::$app->getSession()->setFlash('error', 'Wrong password!'); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $model = Yii::$container->get(\site\models\ChangePasswordForm::class, [Yii::$app->user->identity]); |
| 105 | 105 | |
| 106 | 106 | if ($model->load(Yii::$app->request->post())) { |
| 107 | - if($model->validate() && $model->changePassword()) { |
|
| 107 | + if ($model->validate() && $model->changePassword()) { |
|
| 108 | 108 | Yii::$app->getSession()->setFlash('success', 'Password successfully changed'); |
| 109 | 109 | } else { |
| 110 | 110 | Yii::$app->getSession()->setFlash('error', 'Wrong password!'); |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | public function actionChangeEmail(string $token) { |
| 129 | 129 | $user = Yii::$container->get(\common\interfaces\UserInterface::class)->findByChangeEmailToken($token); |
| 130 | 130 | |
| 131 | - if($user) { |
|
| 131 | + if ($user) { |
|
| 132 | 132 | $validator = new \yii\validators\EmailValidator(); |
| 133 | - if($validator->validate($user->desired_email, $error)) { |
|
| 133 | + if ($validator->validate($user->desired_email, $error)) { |
|
| 134 | 134 | $user->removeChangeEmailToken(); |
| 135 | 135 | $user->email = $user->desired_email; |
| 136 | 136 | $user->desired_email = null; |
| 137 | 137 | $user->save(); |
| 138 | - if(!Yii::$app->user->isGuest) { |
|
| 138 | + if (!Yii::$app->user->isGuest) { |
|
| 139 | 139 | Yii::$app->user->logout(); |
| 140 | 140 | Yii::$app->session->setFlash('success', 'Your email address was successfully changed. For security, we\'ve logged you out.'); |
| 141 | 141 | } else { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | public function actionExport() { |
| 157 | 157 | header("Content-Type: text/csv"); |
| 158 | - header("Content-Disposition: attachment; filename=fsa-data-export-".Yii::$app->user->identity->email."-".date('Ymd').".csv"); |
|
| 158 | + header("Content-Disposition: attachment; filename=fsa-data-export-" . Yii::$app->user->identity->email . "-" . date('Ymd') . ".csv"); |
|
| 159 | 159 | |
| 160 | 160 | $reader = Yii::$app->user->identity->getExportData(); |
| 161 | 161 | $fp = fopen('php://output', 'w'); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | fputcsv($fp, $header); |
| 173 | 173 | $user_behavior = Yii::$container->get(\common\interfaces\UserBehaviorInterface::class); |
| 174 | - while($row = $reader->read()) { |
|
| 174 | + while ($row = $reader->read()) { |
|
| 175 | 175 | $row = $user_behavior::decorateWithCategory([$row]); |
| 176 | 176 | $row = Yii::$app->user->identity->cleanExportData($row); |
| 177 | 177 | fputcsv($fp, $row[0]); |