mirror of https://github.com/MISP/MISP
Merge branch '2.4' of github.com:MISP/MISP into 2.4
commit
b3c114a13a
|
@ -2452,7 +2452,7 @@ class UsersController extends AppController
|
|||
$this->set('roles', $roles);
|
||||
$this->set('role_perms', $role_perms);
|
||||
$orgConditions = array('OR' => array('local' => 1));
|
||||
if (!empty($suggestedOrg)) {
|
||||
if (!empty($suggestedOrg) && is_array($suggestedOrg)) {
|
||||
$orgConditions['OR'] = array('Organisation.id' => $suggestedOrg[0]);
|
||||
}
|
||||
$this->set('orgs', $this->User->Organisation->find('list', array(
|
||||
|
|
|
@ -431,7 +431,7 @@ class Organisation extends AppModel
|
|||
|
||||
public function checkDesiredOrg($suggestedOrg, $registration)
|
||||
{
|
||||
if ($suggestedOrg !== false) {
|
||||
if ($suggestedOrg !== false && $suggestedOrg !== -1) {
|
||||
$conditions = array();
|
||||
if (!empty($registration['Inbox']['data']['org_uuid'])) {
|
||||
$conditions = array('Organisation.uuid' => $registration['Inbox']['data']['org_uuid']);
|
||||
|
@ -443,10 +443,10 @@ class Organisation extends AppModel
|
|||
'fields' => array('id', 'name', 'local'),
|
||||
'conditions' => $conditions
|
||||
));
|
||||
if (!empty($suggestedOrg) && $suggestedOrg[0] !== $identifiedOrg['Organisation']['id']) {
|
||||
if (empty($identifiedOrg)) {
|
||||
$suggestedOrg = -1;
|
||||
} else if (!empty($suggestedOrg) && $suggestedOrg[0] !== $identifiedOrg['Organisation']['id']) {
|
||||
$suggestedOrg = false;
|
||||
} else if (empty($identifiedOrg)) {
|
||||
$suggestedOrg = -1;
|
||||
} else {
|
||||
$suggestedOrg = array($identifiedOrg['Organisation']['id'], $identifiedOrg['Organisation']['name'], $identifiedOrg['Organisation']['local']);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
'class' => 'input-xxlarge',
|
||||
'required' => 1,
|
||||
'options' => $orgs,
|
||||
'default' => empty($suggestedOrg) ? false : $suggestedOrg[0]
|
||||
'default' => empty($suggestedOrg[0]) ? false : $suggestedOrg[0]
|
||||
),
|
||||
array(
|
||||
'field' => 'role_id',
|
||||
|
|
Loading…
Reference in New Issue