mirror of https://github.com/MISP/MISP
chg: [workflow] Enable some module by default when updating
parent
acbf0238d0
commit
5e29f975d1
|
@ -227,6 +227,10 @@ class AppModel extends Model
|
|||
case 48:
|
||||
$dbUpdateSuccess = $this->__generateCorrelations();
|
||||
break;
|
||||
case 87:
|
||||
$this->Workflow = Classregistry::init('Workflow');
|
||||
$this->Workflow->enableDefaultModules();
|
||||
break;
|
||||
default:
|
||||
$dbUpdateSuccess = $this->updateDatabase($command);
|
||||
break;
|
||||
|
|
|
@ -56,6 +56,8 @@ class Workflow extends AppModel
|
|||
]
|
||||
];
|
||||
|
||||
/** @var WorkflowGraphTool */
|
||||
public $workflowGraphTool;
|
||||
public $defaultContain = [
|
||||
];
|
||||
|
||||
|
@ -64,6 +66,7 @@ class Workflow extends AppModel
|
|||
private $error_while_loading = [];
|
||||
|
||||
private $module_initialized = false;
|
||||
private $modules_enabled_by_default = ['generic-if', 'distribution-if', 'published-if', 'organisation-if', 'tag-if', 'concurrent-task', 'stop-execution', 'webhook', 'push-zmq'];
|
||||
|
||||
const CAPTURE_FIELDS_EDIT = ['name', 'description', 'timestamp', 'data'];
|
||||
const CAPTURE_FIELDS_ADD = ['uuid', 'name', 'description', 'timestamp', 'data', 'trigger_id'];
|
||||
|
@ -144,6 +147,11 @@ class Workflow extends AppModel
|
|||
$this->updateListeningTriggers($this->workflowToDelete);
|
||||
}
|
||||
|
||||
public function enableDefaultModules()
|
||||
{
|
||||
$this->toggleModules($this->modules_enabled_by_default, true, false);
|
||||
}
|
||||
|
||||
protected function checkTriggerEnabled($trigger_id)
|
||||
{
|
||||
$settingName = sprintf('Plugin.Workflow_triggers_%s', $trigger_id);
|
||||
|
|
Loading…
Reference in New Issue