fix: removed malware-sample and attachment from the attribute type options

- should not be possible to select these via the add/edit attribute functions
pull/1881/head
iglocska 2017-01-27 17:24:41 +01:00
parent 77810838f7
commit 8205bc9294
2 changed files with 20 additions and 0 deletions

View File

@ -255,6 +255,11 @@ class AttributesController extends AppController {
// combobox for types
$types = array_keys($this->Attribute->typeDefinitions);
foreach ($types as $key => $value) {
if (in_array($value, array('malware-sample', 'attachment'))) {
unset($types[$key]);
}
}
$types = $this->_arrayToValuesIndexArray($types);
$this->set('types', $types);
// combobox for categories
@ -747,6 +752,11 @@ class AttributesController extends AppController {
// needed for RBAC
// combobox for types
$types = array_keys($this->Attribute->typeDefinitions);
foreach ($types as $key => $value) {
if (in_array($value, array('malware-sample', 'attachment'))) {
unset($types[$key]);
}
}
$types = $this->_arrayToValuesIndexArray($types);
$this->set('types', $types);
// combobox for categories

View File

@ -437,6 +437,11 @@ class ShadowAttributesController extends AppController {
$this->set('event_id', $eventId);
// combobox for types
$types = array_keys($this->ShadowAttribute->typeDefinitions);
foreach ($types as $key => $value) {
if (in_array($value, array('malware-sample', 'attachment'))) {
unset($types[$key]);
}
}
$types = $this->_arrayToValuesIndexArray($types);
$this->set('types', $types);
// combobox for categories
@ -706,6 +711,11 @@ class ShadowAttributesController extends AppController {
// combobox for types
$types = array_keys($this->ShadowAttribute->typeDefinitions);
foreach ($types as $key => $value) {
if (in_array($value, array('malware-sample', 'attachment'))) {
unset($types[$key]);
}
}
$types = $this->_arrayToValuesIndexArray($types);
$this->set('types', $types);
// combobox for categories