chg: [blocklist] Add comment for automatic event blocklist

pull/6293/head
Jakub Onderka 2020-09-07 18:10:49 +02:00
parent 490cdfb38f
commit 28fc46082b
1 changed files with 8 additions and 2 deletions

View File

@ -498,9 +498,15 @@ class Event extends AppModel
// blocklist the event UUID if the feature is enabled
if (Configure::read('MISP.enableEventBlocklisting') !== false && empty($this->skipBlocklist)) {
$this->EventBlocklist = ClassRegistry::init('EventBlocklist');
$this->EventBlocklist->create();
$orgc = $this->Orgc->find('first', array('conditions' => array('Orgc.id' => $this->data['Event']['orgc_id']), 'recursive' => -1, 'fields' => array('Orgc.name')));
$this->EventBlocklist->save(array('event_uuid' => $this->data['Event']['uuid'], 'event_info' => $this->data['Event']['info'], 'event_orgc' => $orgc['Orgc']['name']));
$this->EventBlocklist->create();
$this->EventBlocklist->save(array(
'event_uuid' => $this->data['Event']['uuid'],
'event_info' => $this->data['Event']['info'],
'event_orgc' => $orgc['Orgc']['name'],
'comment' => __('Automatically blocked by deleting event'),
));
if (!empty($this->data['Event']['id'])) {
if (Configure::read('Plugin.ZeroMQ_enable') && Configure::read('Plugin.ZeroMQ_event_notifications_enable')) {
$pubSubTool = $this->getPubSubTool();