mirror of https://github.com/MISP/MISP
chg: [module:queryModuleServer] Allow skipping trigger execution
parent
2208d01924
commit
ac34456697
|
@ -203,7 +203,7 @@ class Module extends AppModel
|
|||
return "$url:$port";
|
||||
}
|
||||
|
||||
private function __prepareAndExectureForTrigger($postData, $triggerData=[]): bool
|
||||
private function __prepareAndExecuteTrigger($postData, $triggerData=[]): bool
|
||||
{
|
||||
$this->Workflow = ClassRegistry::init('Workflow');
|
||||
$trigger_id = 'enrichment-before-query';
|
||||
|
@ -268,10 +268,10 @@ class Module extends AppModel
|
|||
* @return array|false
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function queryModuleServer(array $postData, $hover = false, $moduleFamily = 'Enrichment', $throwException = false, $triggerData=[])
|
||||
public function queryModuleServer(array $postData, $hover = false, $moduleFamily = 'Enrichment', $throwException = false, $triggerData=[], $skipTrigger=false)
|
||||
{
|
||||
if ($moduleFamily == 'Enrichment') {
|
||||
$success = $this->__prepareAndExectureForTrigger($postData, $triggerData);
|
||||
if ($moduleFamily == 'Enrichment' && empty($skipTrigger)) {
|
||||
$success = $this->__prepareAndExecuteTrigger($postData, $triggerData);
|
||||
if (!$success) {
|
||||
$trigger_id = 'enrichment-before-query';
|
||||
return __('Trigger `%s` blocked enrichment', $trigger_id);
|
||||
|
|
Loading…
Reference in New Issue