mirror of https://github.com/MISP/MISP
chg: [feed] Show filtering on type only for server
parent
8d5f6e6662
commit
bd24e875ee
|
@ -317,6 +317,7 @@ class FeedsController extends AppController
|
|||
$this->set(compact('dropdownData'));
|
||||
$this->set('defaultPullRules', json_encode(Feed::DEFAULT_FEED_PULL_RULES));
|
||||
$this->set('menuData', array('menuList' => 'feeds', 'menuItem' => 'add'));
|
||||
$this->set('pull_scope', 'feed');
|
||||
}
|
||||
|
||||
private function __checkRegex($pattern)
|
||||
|
@ -472,6 +473,7 @@ class FeedsController extends AppController
|
|||
if(!empty($this->request->data['Feed']['rules'])){
|
||||
$this->request->data['Feed']['pull_rules'] = $this->request->data['Feed']['rules'];
|
||||
}
|
||||
$this->set('pull_scope', 'feed');
|
||||
$this->render('add');
|
||||
}
|
||||
|
||||
|
|
|
@ -455,6 +455,7 @@ class ServersController extends AppController
|
|||
|
||||
$this->set('allTags', $this->__getTags());
|
||||
$this->set('host_org_id', Configure::read('MISP.host_org_id'));
|
||||
$this->set('pull_scope', 'server');
|
||||
$this->render('edit');
|
||||
}
|
||||
}
|
||||
|
@ -649,6 +650,7 @@ class ServersController extends AppController
|
|||
$this->set('server', $s);
|
||||
$this->set('id', $id);
|
||||
$this->set('host_org_id', Configure::read('MISP.host_org_id'));
|
||||
$this->set('pull_scope', 'server');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -782,7 +782,7 @@ class Feed extends AppModel
|
|||
}
|
||||
}
|
||||
$url_params = !empty($filterRules['url_params']) ? $filterRules['url_params'] : [];
|
||||
if (!$this->passesURLParamFilters($url_params, $event)) {
|
||||
if (!$this->passesURLParamFilters($url_params, $event['Event'])) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
if (!empty(Configure::read('MISP.enable_synchronisation_filtering_on_type'))) {
|
||||
if ($pull_scope == 'server' && !empty(Configure::read('MISP.enable_synchronisation_filtering_on_type'))) {
|
||||
echo $this->element('serverRuleElements/rules_filtering_type', [
|
||||
'technique' => 'pull',
|
||||
'allowEmptyOptions' => true,
|
||||
|
@ -115,7 +115,7 @@ echo $this->element('genericElements/assetLoader', array(
|
|||
|
||||
<script>
|
||||
var pullRemoteRules404Error = '<?= __('Connection error or the remote version is not supporting remote filter lookups (v2.4.142+). Make sure that the remote instance is accessible and that it is up to date.') ?>'
|
||||
var coreMirrorHints = <?= json_encode($coreMirrorHints) ?>;
|
||||
var coreMirrorHints = <?= json_encode(!empty($coreMirrorHints) ? $coreMirrorHints : []) ?>;
|
||||
var cm;
|
||||
$(function() {
|
||||
var serverID = "<?= isset($id) ? $id : '' ?>"
|
||||
|
|
Loading…
Reference in New Issue