Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/Controller/FeedsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ public function add()
if (empty($feed['Feed']['lookup_visible'])) {
$feed['Feed']['lookup_visible'] = 0;
}
if (empty($feed['Feed']['lock_events'])) {
$feed['Feed']['lock_events'] = 0;
}
if (empty($feed['Feed']['input_source'])) {
$feed['Feed']['input_source'] = 'network';
} else {
Expand Down Expand Up @@ -379,7 +382,8 @@ public function edit($feedId)
'lookup_visible',
'headers',
'orgc_id',
'fixed_event'
'fixed_event',
'lock_events'
],
'afterFind' => function (array $feed) {
$feed['Feed']['settings'] = json_decode($feed['Feed']['settings'], true);
Expand Down
6 changes: 5 additions & 1 deletion app/Model/AppModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class AppModel extends Model
117 => false, 118 => false, 119 => false, 120 => false, 121 => false, 122 => false,
123 => false, 124 => false, 125 => false, 126 => false, 127 => false, 128 => false,
129 => false, 130 => false, 131 => false, 132 => false, 133 => false, 134 => true,
135 => false, 136 => true, 137 => false, 138 => false, 139 => false, 140 => false
135 => false, 136 => true, 137 => false, 138 => false, 139 => false, 140 => false,
141 => false
);

const ADVANCED_UPDATES_DESCRIPTION = array(
Expand Down Expand Up @@ -2480,6 +2481,9 @@ public function updateDatabase($command)
case 140:
$sqlArray[] = "ALTER TABLE `taxii_servers` MODIFY `api_key` TEXT NOT NULL";
break;
case 141:
$sqlArray[] = "ALTER TABLE `feeds` ADD `lock_events` tinyint(1) NOT NULL DEFAULT 0;";
break;
case 'fixNonEmptySharingGroupID':
$sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
$sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
Expand Down
1 change: 1 addition & 0 deletions app/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ private function __prepareEvent($event, array $feed, $filterRules)
} else {
$event['Event']['distribution'] = $feed['Feed']['distribution'];
$event['Event']['sharing_group_id'] = $feed['Feed']['sharing_group_id'];
$event['Event']['lock_events'] = !empty($feed['Feed']['lock_events']) ? 1 : 0;
if ($feed['Feed']['sharing_group_id']) {
$sg = $this->SharingGroup->find('first', array(
'recursive' => -1,
Expand Down
6 changes: 6 additions & 0 deletions app/View/Feeds/add.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ echo $this->element('genericElements/Form/genericForm', [
'label' => __('Unpublish events'),
'type' => 'checkbox'
],
[
'field' => 'lock_events',
'label' => __('Lock events'),
'title' => __('Lock events created from this feed (allows sync users to edit them)'),
'type' => 'checkbox'
],
[
'field' => 'name',
'label' => __('Name'),
Expand Down
13 changes: 12 additions & 1 deletion db_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3478,6 +3478,17 @@
"column_type": "int(11)",
"column_default": "0",
"extra": ""
},
{
"column_name": "lock_events",
"is_nullable": "NO",
"data_type": "tinyint",
"character_maximum_length": null,
"numeric_precision": "3",
"collation_name": null,
"column_type": "tinyint(1)",
"column_default": "0",
"extra": ""
}
],
"fuzzy_correlate_ssdeep": [
Expand Down Expand Up @@ -11029,4 +11040,4 @@
}
},
"db_version": "140"
}
}
Loading