fix: [registration] acceptRegistration now accepts non User wrapped input

pull/5256/head
iglocska 2020-05-06 21:40:04 +02:00
parent c8e9fa1c76
commit cd7d01306d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 3 additions and 0 deletions

View File

@ -2570,6 +2570,9 @@ class UsersController extends AppController
'perm_admin' => $role['Role']['perm_admin']
);
}
if (empty($this->request->data['User'])) {
$this->request->data = array('User' => $this->request->data);
}
if (!empty($default_role)) {
$this->request->data['User']['role_id'] = $default_role['Role']['id'];
}