@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $result->get('login') |
| 64 | 64 | ))); |
| 65 | 65 | |
| 66 | - return $this->App->redirect(['apply' => ['action' => 'edit', $result->id]]); |
|
| 66 | + return $this->App->redirect([ 'apply' => [ 'action' => 'edit', $result->id ] ]); |
|
| 67 | 67 | } else { |
| 68 | 68 | $this->Flash->error(__d('community', 'User could not be updated. Please, try again.')); |
| 69 | 69 | } |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function changePassword($id = null) |
| 86 | 86 | { |
| 87 | - $user = $this->Users->get($id, ['contain' => []]); |
|
| 87 | + $user = $this->Users->get($id, [ 'contain' => [ ] ]); |
|
| 88 | 88 | $user->set('password', null); |
| 89 | 89 | |
| 90 | - if ($this->request->is(['patch', 'post', 'put'])) { |
|
| 90 | + if ($this->request->is([ 'patch', 'post', 'put' ])) { |
|
| 91 | 91 | $user = $this->Users->patchEntity($user, $this->request->getData()); |
| 92 | 92 | if ($result = $this->Users->save($user)) { |
| 93 | 93 | $this->Flash->success(__d('community', 'Password has been updated.')); |
| 94 | - return $this->App->redirect(['apply' => ['action' => 'edit', $result->id]]); |
|
| 94 | + return $this->App->redirect([ 'apply' => [ 'action' => 'edit', $result->id ] ]); |
|
| 95 | 95 | } else { |
| 96 | 96 | $this->Flash->error(__d('community', 'Password could not be updated. Please, try again.')); |
| 97 | 97 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $user = $this->Users->get($id); |
| 119 | 119 | $groups = $this->Users->Groups->getTreeList(); |
| 120 | 120 | |
| 121 | - if ($this->request->is(['patch', 'post', 'put'])) { |
|
| 121 | + if ($this->request->is([ 'patch', 'post', 'put' ])) { |
|
| 122 | 122 | $group = $this->Users->patchEntity($user, $this->request->getData()); |
| 123 | 123 | if ($result = $this->Users->save($group)) { |
| 124 | 124 | $this->Flash->success(__d('community', 'The user {0} has been saved.', sprintf( |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $result->get('login') |
| 127 | 127 | ))); |
| 128 | 128 | return $this->App->redirect([ |
| 129 | - 'apply' => ['action' => 'edit', $result->id] |
|
| 129 | + 'apply' => [ 'action' => 'edit', $result->id ] |
|
| 130 | 130 | ]); |
| 131 | 131 | } else { |
| 132 | 132 | $this->Flash->error(__d('community', 'User could not be updated. Please, try again.')); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | public function initialize() |
| 170 | 170 | { |
| 171 | 171 | parent::initialize(); |
| 172 | - $this->Security->setConfig('unlockedFields', ['password', 'password_confirm']); |
|
| 172 | + $this->Security->setConfig('unlockedFields', [ 'password', 'password_confirm' ]); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | 'message' => __d('community', 'User with this login already exists.') |
| 77 | 77 | ]) |
| 78 | 78 | ->add('login', 'length', [ |
| 79 | - 'rule' => ['minLength', MIN_LENGTH_LOGIN], |
|
| 79 | + 'rule' => [ 'minLength', MIN_LENGTH_LOGIN ], |
|
| 80 | 80 | 'message' => __d('community', 'The minimum login length must be {0} characters', MIN_LENGTH_LOGIN) |
| 81 | 81 | ]); |
| 82 | 82 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | 'message' => __d('community', 'User with this alias already exists.') |
| 90 | 90 | ]) |
| 91 | 91 | ->add('slug', 'length', [ |
| 92 | - 'rule' => ['minLength', MIN_LENGTH_LOGIN], |
|
| 92 | + 'rule' => [ 'minLength', MIN_LENGTH_LOGIN ], |
|
| 93 | 93 | 'message' => __d('community', 'The minimum alias length must be {0} characters', MIN_LENGTH_LOGIN) |
| 94 | 94 | ]); |
| 95 | 95 | |
@@ -113,14 +113,14 @@ discard block |
||
| 113 | 113 | $validator |
| 114 | 114 | ->notEmpty('password', __d('community', 'Please, enter you password.')) |
| 115 | 115 | ->add('password', 'minLength', [ |
| 116 | - 'rule' => ['minLength', MIN_LENGTH_PASS], |
|
| 116 | + 'rule' => [ 'minLength', MIN_LENGTH_PASS ], |
|
| 117 | 117 | 'message' => __d('community', 'The minimum password length is {0}', MIN_LENGTH_PASS) |
| 118 | 118 | ]); |
| 119 | 119 | |
| 120 | 120 | $validator |
| 121 | 121 | ->notEmpty('password_confirm', __d('community', 'Please, confirm you password.')) |
| 122 | 122 | ->add('password_confirm', 'no-misspelling', [ |
| 123 | - 'rule' => ['compareWith', 'password'], |
|
| 123 | + 'rule' => [ 'compareWith', 'password' ], |
|
| 124 | 124 | 'message' => __d('community', 'Passwords are not equal') |
| 125 | 125 | ]); |
| 126 | 126 | |