@@ -157,7 +157,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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(); |
@@ -220,14 +220,17 @@ |
||
| 220 | 220 | $errors = []; |
| 221 | 221 | |
| 222 | 222 | $isValid = true; |
| 223 | - try { |
|
| 223 | + try |
|
| 224 | + { |
|
| 224 | 225 | Validator::make([ |
| 225 | 226 | 'password' => $values['customer.newpassword'], |
| 226 | 227 | 'password_confirmation' => $values['customer.confirmnewpassword'] |
| 227 | 228 | ], [ |
| 228 | 229 | 'password' => ['required', 'string', new Password, 'confirmed'] |
| 229 | 230 | ])->validate(); |
| 230 | - } catch (\Exception $ex) { |
|
| 231 | + } |
|
| 232 | + catch (\Exception $ex) |
|
| 233 | + { |
|
| 231 | 234 | $isValid = false; |
| 232 | 235 | $errors['passwordRules'] = "The password does not meet the password requirements!"; |
| 233 | 236 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 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' ) ?> |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | <?= $this->csrf()->formfield() ?> |
| 98 | 98 | |
| 99 | 99 | <div class="row password-change-notifications"> |
| 100 | - <?php if ( $this->get('passwordChanged', null) === true ) : ?> |
|
| 101 | - <h2 class="text-success"><?= $this->translate('client', 'Password changed successfull!') ?></h2> |
|
| 102 | - <?php elseif ($this->get('passwordChanged', null) === false) : ?> |
|
| 103 | - <h2 class="text-danger"><?= $this->translate('client', 'Error(s) occured!') ?></h2> |
|
| 100 | + <?php if( $this->get( 'passwordChanged', null ) === true ) : ?> |
|
| 101 | + <h2 class="text-success"><?= $this->translate( 'client', 'Password changed successfull!' ) ?></h2> |
|
| 102 | + <?php elseif( $this->get( 'passwordChanged', null ) === false ) : ?> |
|
| 103 | + <h2 class="text-danger"><?= $this->translate( 'client', 'Error(s) occured!' ) ?></h2> |
|
| 104 | 104 | <?php endif ?> |
| 105 | 105 | </div> |
| 106 | 106 | <div class="row"> |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.oldpassword' ) ) ) ?>" |
| 118 | 118 | placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>" |
| 119 | 119 | > |
| 120 | - <?php if( isset($passwordErrors['oldPassword']) ) : ?> |
|
| 120 | + <?php if( isset( $passwordErrors['oldPassword'] ) ) : ?> |
|
| 121 | 121 | <span class="invalid-feedback d-block" role="alert"> |
| 122 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['oldPassword'])) ?></strong> |
|
| 122 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['oldPassword'] ) ) ?></strong> |
|
| 123 | 123 | </span> |
| 124 | 124 | <?php endif ?> |
| 125 | 125 | </div> |
@@ -136,19 +136,19 @@ discard block |
||
| 136 | 136 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.newpassword' ) ) ) ?>" |
| 137 | 137 | placeholder="<?= $enc->attr( $this->translate( 'client', 'New password' ) ) ?>" |
| 138 | 138 | > |
| 139 | - <?php if( isset($passwordErrors['confirm']) ) : ?> |
|
| 139 | + <?php if( isset( $passwordErrors['confirm'] ) ) : ?> |
|
| 140 | 140 | <span class="invalid-feedback d-block" role="alert"> |
| 141 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong> |
|
| 141 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong> |
|
| 142 | 142 | </span> |
| 143 | 143 | <?php endif ?> |
| 144 | - <?php if( isset($passwordErrors['isNew']) ) : ?> |
|
| 144 | + <?php if( isset( $passwordErrors['isNew'] ) ) : ?> |
|
| 145 | 145 | <span class="invalid-feedback d-block" role="alert"> |
| 146 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong> |
|
| 146 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong> |
|
| 147 | 147 | </span> |
| 148 | 148 | <?php endif ?> |
| 149 | - <?php if( isset($passwordErrors['passwordRules']) ) : ?> |
|
| 149 | + <?php if( isset( $passwordErrors['passwordRules'] ) ) : ?> |
|
| 150 | 150 | <span class="invalid-feedback d-block" role="alert"> |
| 151 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['passwordRules'])) ?></strong> |
|
| 151 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['passwordRules'] ) ) ?></strong> |
|
| 152 | 152 | </span> |
| 153 | 153 | <?php endif ?> |
| 154 | 154 | </div> |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.confirmnewpassword' ) ) ) ?>" |
| 165 | 165 | placeholder="<?= $enc->attr( $this->translate( 'client', 'Confirm password' ) ) ?>" |
| 166 | 166 | > |
| 167 | - <?php if( isset($passwordErrors['confirm']) ) : ?> |
|
| 167 | + <?php if( isset( $passwordErrors['confirm'] ) ) : ?> |
|
| 168 | 168 | <span class="invalid-feedback d-block" role="alert"> |
| 169 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong> |
|
| 169 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong> |
|
| 170 | 170 | </span> |
| 171 | 171 | <?php endif ?> |
| 172 | - <?php if( isset($passwordErrors['isNew']) ) : ?> |
|
| 172 | + <?php if( isset( $passwordErrors['isNew'] ) ) : ?> |
|
| 173 | 173 | <span class="invalid-feedback d-block" role="alert"> |
| 174 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong> |
|
| 174 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong> |
|
| 175 | 175 | </span> |
| 176 | 176 | <?php endif ?> |
| 177 | 177 | </div> |