fix: [user:edit] Correctly re-insert form data wipping password

information
pull/5687/head
mokaddem 2020-03-06 16:17:28 +01:00
parent fc0ed4c9a0
commit 40560b8873
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 8 additions and 3 deletions

View File

@ -209,11 +209,16 @@ class UsersController extends AppController
}
}
if ($abortPost) {
return $this->RestResponse->saveFailResponse('Users', 'edit', $id, $message, $this->response->type());
} else {
$this->Flash->error($message);
$this->request->data['User']['password'] = '';
$this->request->data['User']['confirm_password'] = '';
if ($this->_isRest()) {
return $this->RestResponse->saveFailResponse('Users', 'edit', $id, $message, $this->response->type());
} else {
$this->Flash->error($message);
}
}
} else {
$this->User->data = $currentUser;
$this->User->set('password', '');
$this->request->data = $this->User->data;
}