@@ -69,16 +69,16 @@ |
||
69 | 69 | public function saveProfile() |
70 | 70 | { |
71 | 71 | if ($this->validate()) { |
72 | - $user = $this->user; |
|
72 | + $user = $this->user; |
|
73 | 73 | |
74 | - if($this->timezone) |
|
74 | + if ($this->timezone) |
|
75 | 75 | $user->timezone = $this->timezone; |
76 | - if($this->expose_graph) { |
|
76 | + if ($this->expose_graph) { |
|
77 | 77 | $user->expose_graph = true; |
78 | 78 | } else { |
79 | 79 | $user->expose_graph = false; |
80 | 80 | } |
81 | - if($this->send_email) { |
|
81 | + if ($this->send_email) { |
|
82 | 82 | $user->partner_email1 = $this->partner_email1; |
83 | 83 | $user->partner_email2 = $this->partner_email2; |
84 | 84 | $user->partner_email3 = $this->partner_email3; |
@@ -71,8 +71,9 @@ |
||
71 | 71 | if ($this->validate()) { |
72 | 72 | $user = $this->user; |
73 | 73 | |
74 | - if($this->timezone) |
|
75 | - $user->timezone = $this->timezone; |
|
74 | + if($this->timezone) { |
|
75 | + $user->timezone = $this->timezone; |
|
76 | + } |
|
76 | 77 | if($this->expose_graph) { |
77 | 78 | $user->expose_graph = true; |
78 | 79 | } else { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | <?= $form->field($model, 'subject') ?> |
58 | 58 | <?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> |
59 | 59 | |
60 | - <?php if(Yii::$app->user->isGuest) { |
|
60 | + <?php if (Yii::$app->user->isGuest) { |
|
61 | 61 | // only show captcha if user is not logged in |
62 | 62 | print $form->field($model, 'verifyCode')->widget(Captcha::class, [ |
63 | 63 | 'template' => '<div class="row"><div class="col-md-4">{image}</div><div class="col-md-8">{input}</div></div>', |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | public function actionBlog() |
77 | 77 | { |
78 | 78 | $time = Yii::$container->get(\common\interfaces\TimeInterface::class); |
79 | - $key = "index_blog_".$time->getLocalDate('UTC'); |
|
79 | + $key = "index_blog_" . $time->getLocalDate('UTC'); |
|
80 | 80 | $posts = Yii::$app->cache->get($key); |
81 | - if($posts === false) { |
|
81 | + if ($posts === false) { |
|
82 | 82 | $posts = \Yii::$app->getModule('blog') |
83 | 83 | ->fetch() |
84 | 84 | ->parse() |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $model = new ContactForm(); |
113 | 113 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
114 | - if($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
114 | + if ($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
115 | 115 | Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); |
116 | 116 | } else { |
117 | 117 | Yii::$app->session->setFlash('error', 'There was an error sending email.'); |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | public function actionSignup() |
144 | 144 | { |
145 | 145 | $model = Yii::$container->get(\site\models\SignupForm::class); |
146 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
146 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
147 | 147 | $model->signup(); |
148 | 148 | 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.'); |
149 | - return $this->redirect('/',302); |
|
149 | + return $this->redirect('/', 302); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | return $this->render('signup', [ |
@@ -157,10 +157,10 @@ discard block |
||
157 | 157 | public function actionRequestPasswordReset() |
158 | 158 | { |
159 | 159 | $model = Yii::$container->get(\site\models\PasswordResetRequestForm::class); |
160 | - if($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
161 | - if(!$model->sendEmail()) { |
|
160 | + if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
161 | + if (!$model->sendEmail()) { |
|
162 | 162 | $ip = Yii::$app->getRequest()->getUserIP() ?: "UNKNOWN"; |
163 | - Yii::warning("$ip has tried to reset the password for ".$model->email); |
|
163 | + Yii::warning("$ip has tried to reset the password for " . $model->email); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | Yii::$app->getSession()->setFlash('success', 'If there is an account with the submitted email address you will receive further instructions in your email inbox.'); |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | 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."); |
204 | 204 | } |
205 | 205 | |
206 | - if($user->isTokenConfirmed($user->verify_email_token)) { |
|
206 | + if ($user->isTokenConfirmed($user->verify_email_token)) { |
|
207 | 207 | Yii::$app->getSession()->setFlash('success', 'Your account has already been verified. Please log in.'); |
208 | - return $this->redirect('/login',302); |
|
208 | + return $this->redirect('/login', 302); |
|
209 | 209 | } else if (Yii::$app->getUser()->login($user)) { |
210 | 210 | $user->confirmVerifyEmailToken(); |
211 | 211 | $user->save(); |
212 | 212 | Yii::$app->getSession()->setFlash('success', 'Your account has been verified. Please continue with your check-in.'); |
213 | - return $this->redirect('/welcome',302); |
|
213 | + return $this->redirect('/welcome', 302); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | public function actionExport() |
228 | 228 | { |
229 | 229 | header("Content-Type: text/csv"); |
230 | - header("Content-Disposition: attachment; filename=fsa-data-export-".Yii::$app->user->identity->email."-".date('Ymd').".csv"); |
|
230 | + header("Content-Disposition: attachment; filename=fsa-data-export-" . Yii::$app->user->identity->email . "-" . date('Ymd') . ".csv"); |
|
231 | 231 | |
232 | 232 | $reader = Yii::$app->user->identity->getExportData(); |
233 | 233 | $fp = fopen('php://output', 'w'); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | fputcsv($fp, $header); |
245 | 245 | $user_behavior = Yii::$container->get(\common\interfaces\UserBehaviorInterface::class); |
246 | - while($row = $reader->read()) { |
|
246 | + while ($row = $reader->read()) { |
|
247 | 247 | $row = $user_behavior::decorateWithCategory([$row]); |
248 | 248 | $row = Yii::$app->user->identity->cleanExportData($row); |
249 | 249 | fputcsv($fp, $row[0]); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | ]); ?> |
25 | 25 | <?= $form->field($profile, 'timezone')->dropDownList(array_combine($timezones, $timezones)); ?> |
26 | 26 | <?= $form->field($profile, 'send_email')->checkbox() ?> |
27 | - <div id='send_email_fields' <?php if(!$profile->send_email) { ?>style="display: none;"<?php } ?>> |
|
27 | + <div id='send_email_fields' <?php if (!$profile->send_email) { ?>style="display: none;"<?php } ?>> |
|
28 | 28 | <?= $form->field($profile, 'partner_email1')->input('email'); ?> |
29 | 29 | <?= $form->field($profile, 'partner_email2')->input('email'); ?> |
30 | 30 | <?= $form->field($profile, 'partner_email3')->input('email'); ?> |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | ]); ?> |
95 | 95 | <?= $form->field($profile, 'timezone')->dropDownList(array_combine($timezones, $timezones)); ?> |
96 | 96 | <?= $form->field($profile, 'expose_graph')->checkbox() ?> |
97 | - <?php if($profile->expose_graph): ?> |
|
97 | + <?php if ($profile->expose_graph): ?> |
|
98 | 98 | <div class='alert alert-success score-graph-info'>Your score graph can be found at:<br /> <a id="score-graph-link" target="_blank" href="<?=$graph_url?>"><?=$graph_url?></a></div> |
99 | 99 | <?php endif; ?> |
100 | 100 | <?= $form->field($profile, 'send_email')->checkbox() ?> |
101 | - <div id='email_threshold_fields' <?php if(!$profile->send_email) { ?>style="display: none;"<?php } ?>> |
|
101 | + <div id='email_threshold_fields' <?php if (!$profile->send_email) { ?>style="display: none;"<?php } ?>> |
|
102 | 102 | <?= $form->field($profile, 'email_threshold')->textInput(['class'=>'form-control', 'style'=>'width: 50px;'])->input('number', ['min' => 0, 'max' => 1000]) ?> |
103 | 103 | <?= $form->field($profile, 'partner_email1')->input('email'); ?> |
104 | 104 | <?= $form->field($profile, 'partner_email2')->input('email'); ?> |