Merge pull request #7405 from righel/fix-edit-servers-via-api-when-host_org_id-is-empty

fix: servers cannot be edited via API when MISP.host_org_id setting i…
pull/7427/head
Andras Iklody 2021-05-11 15:09:25 +02:00 committed by GitHub
commit eac96b4b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -455,14 +455,14 @@ class ServersController extends AppController
$this->redirect(array('controller' => 'servers', 'action' => 'index'));
}
if ($this->request->is('post') || $this->request->is('put')) {
if (empty(Configure::read('MISP.host_org_id'))) {
$this->request->data['Server']['internal'] = 0;
}
if ($this->_isRest()) {
if (!isset($this->request->data['Server'])) {
$this->request->data = array('Server' => $this->request->data);
}
}
if (empty(Configure::read('MISP.host_org_id'))) {
$this->request->data['Server']['internal'] = 0;
}
if (isset($this->request->data['Server']['json'])) {
$json = json_decode($this->request->data['Server']['json'], true);
} else {