mirror of https://github.com/MISP/MISP
fix: [sync] Sync object builder tool fixed
- was picking the wrong org as the owner of the remote sidepull/4980/head
parent
3186b8781e
commit
b2f3481806
|
@ -1993,14 +1993,27 @@ misp.direct_call(relative_path, body)
|
|||
$baseurl = Router::url('/', true);
|
||||
}
|
||||
}
|
||||
$host_org_id = Configure::read('MISP.host_org_id');
|
||||
if (empty($host_org_id)) {
|
||||
throw new MethodNotAllowedException(__('Cannot create sync config - no host org ID configured for the instance.'));
|
||||
}
|
||||
$this->loadModel('Organisation');
|
||||
$host_org = $this->Organisation->find('first', array(
|
||||
'conditions' => array('Organisation.id' => $host_org_id),
|
||||
'recursive' => -1,
|
||||
'fields' => array('name', 'uuid')
|
||||
));
|
||||
if (empty($host_org)) {
|
||||
throw new MethodNotAllowedException(__('Configured host org not found. Please make sure that the setting is current on the instance.'));
|
||||
}
|
||||
$server = array(
|
||||
'Server' => array(
|
||||
'url' => $baseurl,
|
||||
'uuid' => Configure::read('MISP.uuid'),
|
||||
'authkey' => $this->Auth->user('authkey'),
|
||||
'Organisation' => array(
|
||||
'name' => $this->Auth->user('Organisation')['name'],
|
||||
'uuid' => $this->Auth->user('Organisation')['uuid']
|
||||
'name' => $host_org['Organisation']['name'],
|
||||
'uuid' => $host_org['Organisation']['uuid'],
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue