Passed
Pull Request — master (#152)
by
unknown
08:44
created
client/html/templates/account/profile/account-body-standard.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @see client/html/account/profile/url/config
87 87
  */
88 88
 
89
-$passwordErrors = $this->get('passwordErrors', []);
89
+$passwordErrors = $this->get( 'passwordErrors', [] );
90 90
 
91 91
 ?>
92 92
 <?php $this->block()->start( 'account/profile/account' ) ?>
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
     <h1 class="header"><?= $enc->html( $this->translate( 'client', 'account' ) ) ?></h1>
96 96
     <form class="container-fluid" method="POST" action="<?= $enc->attr( $this->link( 'client/html/account/profile/url' ) ) ?>">
97 97
         <?= $this->csrf()->formfield() ?>
98
-        <?php if ( $this->get('passwordChanged', null) === true ) : ?>
98
+        <?php if( $this->get( 'passwordChanged', null ) === true ) : ?>
99 99
             <div class="row d-flex justify-content-center">
100
-                <h2 class="text-success"><?= $this->translate('client', 'Password changed successfull!') ?></h2>
100
+                <h2 class="text-success"><?= $this->translate( 'client', 'Password changed successfull!' ) ?></h2>
101 101
             </div>
102
-        <?php elseif ($this->get('passwordChanged', null) === false) :?>
102
+        <?php elseif( $this->get( 'passwordChanged', null ) === false ) :?>
103 103
             <div class="row d-flex justify-content-center">
104
-                <h2 class="text-danger"><?= $this->translate('client', 'Error(s) occured!') ?></h2>
104
+                <h2 class="text-danger"><?= $this->translate( 'client', 'Error(s) occured!' ) ?></h2>
105 105
             </div>
106 106
         <?php endif ?>
107 107
         <div class="row">
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.oldpassword' ) ) ) ?>"
119 119
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>"
120 120
                             >
121
-                            <?php if( isset($passwordErrors['oldPassword']) ) : ?>
121
+                            <?php if( isset( $passwordErrors['oldPassword'] ) ) : ?>
122 122
                                 <span class="invalid-feedback d-block" role="alert">
123
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['oldPassword'])) ?></strong>
123
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['oldPassword'] ) ) ?></strong>
124 124
                                 </span>
125 125
                             <?php endif ?>
126 126
                         </div>
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.newpassword' ) ) ) ?>"
138 138
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'New password' ) ) ?>"
139 139
                             >
140
-                            <?php if( isset($passwordErrors['confirm']) ) : ?>
140
+                            <?php if( isset( $passwordErrors['confirm'] ) ) : ?>
141 141
                                 <span class="invalid-feedback d-block" role="alert">
142
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong>
142
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong>
143 143
                                 </span>
144 144
                             <?php endif ?>
145
-                            <?php if( isset($passwordErrors['isNew']) ) : ?>
145
+                            <?php if( isset( $passwordErrors['isNew'] ) ) : ?>
146 146
                                 <span class="invalid-feedback d-block" role="alert">
147
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong>
147
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong>
148 148
                                 </span>
149 149
                             <?php endif ?>
150
-                            <?php if( isset($passwordErrors['passwordRules']) ) : ?>
150
+                            <?php if( isset( $passwordErrors['passwordRules'] ) ) : ?>
151 151
                                 <span class="invalid-feedback d-block" role="alert">
152
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['passwordRules'])) ?></strong>
152
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['passwordRules'] ) ) ?></strong>
153 153
                                 </span>
154 154
                             <?php endif ?>
155 155
                         </div>
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.confirmnewpassword' ) ) ) ?>"
166 166
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'Confirm password' ) ) ?>"
167 167
                             >
168
-                            <?php if( isset($passwordErrors['confirm']) ) : ?>
168
+                            <?php if( isset( $passwordErrors['confirm'] ) ) : ?>
169 169
                                 <span class="invalid-feedback d-block" role="alert">
170
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong>
170
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong>
171 171
                                 </span>
172 172
                             <?php endif ?>
173
-                            <?php if( isset($passwordErrors['isNew']) ) : ?>
173
+                            <?php if( isset( $passwordErrors['isNew'] ) ) : ?>
174 174
                                 <span class="invalid-feedback d-block" role="alert">
175
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong>
175
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong>
176 176
                                 </span>
177 177
                             <?php endif ?>
178 178
                         </div>
Please login to merge, or discard this patch.
client/html/src/Client/Html/Account/Profile/Account/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @return string HTML code
158 158
      * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception
159 159
      */
160
-    public function getBody(string $uid = ''): string
160
+    public function getBody( string $uid = '' ): string
161 161
     {
162 162
         $view = $this->getView();
163 163
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     {
205 205
         $view = $this->getView();
206 206
 
207
-        if( !$view->param( 'account/save' , false) ) {
207
+        if( !$view->param( 'account/save', false ) ) {
208 208
             parent::process();
209 209
             return;
210 210
         }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */
213 213
         $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' );
214 214
         $oldPassword = $cntl->get()->getPassword();
215
-        $values = $view->param('account', []);
215
+        $values = $view->param( 'account', [] );
216 216
 
217 217
         $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
218 218
         $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
@@ -221,39 +221,39 @@  discard block
 block discarded – undo
221 221
 
222 222
         $isValid = true;
223 223
         try {
224
-            Validator::make([
224
+            Validator::make( [
225 225
                 'password' => $values['customer.newpassword'],
226 226
                 'password_confirmation' => $values['customer.confirmnewpassword']
227 227
             ], [
228 228
                 'password' => ['required', 'string', new Password, 'confirmed']
229
-            ])->validate();
230
-        } catch (\Exception $ex) {
229
+            ] )->validate();
230
+        } catch( \Exception $ex ) {
231 231
             $isValid = false;
232 232
             $errors['passwordRules'] = "The password does not meet the password requirements!";
233 233
         }
234 234
 
235
-        if ($isValid) {
235
+        if( $isValid ) {
236 236
             /** is the password realy new? */
237
-            if (!$isNew) {
237
+            if( !$isNew ) {
238 238
                 $errors['isNew'] = "The given password is not new!";
239 239
             }
240 240
 
241 241
             /** does the confirm password is the same? */
242
-            if (!$confirmed) {
242
+            if( !$confirmed ) {
243 243
                 $errors["confirm"] = "New passwords doesnt match!";
244 244
             }
245 245
 
246
-            $cntl = $cntl->add($values);
246
+            $cntl = $cntl->add( $values );
247 247
 
248 248
         }
249 249
         /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */
250
-        if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
250
+        if( $isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
251 251
                 $errors['oldPassword'] = "Wrong password!";
252 252
         }
253 253
 
254
-        $view->passwordChanged = count(array_keys($errors)) === 0;
254
+        $view->passwordChanged = count( array_keys( $errors ) ) === 0;
255 255
 
256
-        if (count(array_keys($errors)) > 0) {
256
+        if( count( array_keys( $errors ) ) > 0 ) {
257 257
             $view->passwordErrors = $errors;
258 258
         } else {
259 259
             $cntl->store();
Please login to merge, or discard this patch.