chg: Add in ability to update sightings against each attribute from a POSTed MISP Event

pull/6938/head
Tom King 2021-02-01 14:10:39 +00:00
parent 2b5b5f97de
commit 07b79aee78
1 changed files with 6 additions and 0 deletions

View File

@ -4077,6 +4077,12 @@ class Attribute extends AppModel
$attribute['distribution'] = 5;
}
}
if (isset($attribute['Sighting']) && !empty($attribute['Sighting'])) {
$this->Sighting = ClassRegistry::init('Sighting');
foreach ($attribute['Sighting'] as $s) {
$result = $this->Sighting->saveSightings($attribute['uuid'], false, $s['date_sighting'], $user, $s['type'], $s['source'], isset($s['uuid']) ? $s['uuid']: false);
}
}
$fieldList = $this->editableFields;
if (empty($existingAttribute)) {
$addableFieldList = array('event_id', 'type', 'uuid');