fix: [user registration] reverted bug introduced in previous commit restricting the org choice to the suggested org if there was a match

pull/5560/head
iglocska 2020-04-07 22:20:56 +02:00
parent fb4eb05663
commit 78c1357593
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 2 deletions

View File

@ -2452,8 +2452,8 @@ class UsersController extends AppController
$this->set('roles', $roles);
$this->set('role_perms', $role_perms);
$orgConditions = array('OR' => array('local' => 1));
if (!empty($suggestedOrg) && is_array($suggestedOrg)) {
$orgConditions['OR'] = array('Organisation.id' => $suggestedOrg[0]);
if (!empty($suggestedOrg)) {
$orgConditions['OR'][] = array('Organisation.id' => $suggestedOrg[0]);
}
$this->set('orgs', $this->User->Organisation->find('list', array(
'fields' => array('id', 'name'),