mirror of https://github.com/MISP/MISP
fix: [workflow-module:publish-event] Extend correct class and use event id
parent
b3591aeefd
commit
2b030fb496
|
@ -1,13 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
include_once APP . 'Model/WorkflowModules/action/Module_webhook.php';
|
include_once APP . 'Model/WorkflowModules/WorkflowBaseModule.php';
|
||||||
|
|
||||||
class Module_publish_event extends Module_webhook
|
class Module_publish_event extends WorkflowBaseActionModule
|
||||||
{
|
{
|
||||||
public $id = 'publish-event';
|
public $id = 'publish-event';
|
||||||
public $name = 'Publish Event';
|
public $name = 'Publish Event';
|
||||||
public $version = '0.1';
|
public $version = '0.1';
|
||||||
public $description = 'Publish an Event in the context of the workflow';
|
public $description = 'Publish an Event in the context of the workflow';
|
||||||
public $icon_path = 'upload';
|
public $icon = 'upload';
|
||||||
|
public $inputs = 1;
|
||||||
|
public $outputs = 1;
|
||||||
|
public $params = [];
|
||||||
|
|
||||||
private $Event;
|
private $Event;
|
||||||
|
|
||||||
|
@ -22,6 +25,8 @@ class Module_publish_event extends Module_webhook
|
||||||
|
|
||||||
public function exec(array $node, WorkflowRoamingData $roamingData, array &$errors = []): bool
|
public function exec(array $node, WorkflowRoamingData $roamingData, array &$errors = []): bool
|
||||||
{
|
{
|
||||||
|
$rData = $roamingData->getData();
|
||||||
|
$event_id = $rData['Event']['id'];
|
||||||
$result = $this->Event->publish($event_id, null);
|
$result = $this->Event->publish($event_id, null);
|
||||||
return $result === true;
|
return $result === true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue