mirror of https://github.com/MISP/MISP
attach found sightings to event item
parent
719bcb5a65
commit
b321ef7a20
|
@ -2958,6 +2958,13 @@ class Event extends AppModel
|
|||
}
|
||||
}
|
||||
}
|
||||
// zeroq: check if sightings are attached and add to event
|
||||
if (isset($data['Sighting']) && !empty($data['Sighting'])) {
|
||||
$this->Sighting = ClassRegistry::init('Sighting');
|
||||
foreach ($data['Sighting'] as $s) {
|
||||
$result = $this->Sighting->saveSightings($s['attribute_uuid'], false, $s['date_sighting'], $user, $s['type'], $s['source']);
|
||||
}
|
||||
}
|
||||
if ($fromXml) {
|
||||
$created_id = $this->id;
|
||||
}
|
||||
|
@ -3119,6 +3126,13 @@ class Event extends AppModel
|
|||
}
|
||||
}
|
||||
}
|
||||
// zeroq: if sightings then attach to event
|
||||
if (isset($data['Sighting']) && !empty($data['Sighting'])) {
|
||||
$this->Sighting = ClassRegistry::init('Sighting');
|
||||
foreach ($data['Sighting'] as $s) {
|
||||
$result = $this->Sighting->saveSightings($s['attribute_uuid'], false, $s['date_sighting'], $user, $s['type'], $s['source']);
|
||||
}
|
||||
}
|
||||
// if published -> do the actual publishing
|
||||
if ((!empty($data['Event']['published']) && 1 == $data['Event']['published'])) {
|
||||
// do the necessary actions to publish the event (email, upload,...)
|
||||
|
|
Loading…
Reference in New Issue