fix: [internal] ThreatLevel::list() function renamed

- causes issues under certain PHP versions as it's a reserved keyword
pull/7276/head
iglocska 2021-03-30 09:38:41 +02:00
parent 6f18680083
commit 8f13e5f41a
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
4 changed files with 7 additions and 7 deletions

View File

@ -590,7 +590,7 @@ class EventsController extends AppController
$searchTermInternal = $searchTerm; $searchTermInternal = $searchTerm;
if ($searchTerm == 'threatlevel') { if ($searchTerm == 'threatlevel') {
$searchTermInternal = 'threat_level_id'; $searchTermInternal = 'threat_level_id';
$terms = $this->Event->ThreatLevel->list(); $terms = $this->Event->ThreatLevel->listThreatLevels();
} elseif ($searchTerm == 'analysis') { } elseif ($searchTerm == 'analysis') {
$terms = $this->Event->analysisLevels; $terms = $this->Event->analysisLevels;
} else { } else {
@ -4694,7 +4694,7 @@ class EventsController extends AppController
$this->render('/Elements/view_galaxy_matrix'); $this->render('/Elements/view_galaxy_matrix');
} }
} }
// Displays all the cluster relations for the provided event // Displays all the cluster relations for the provided event
public function viewClusterRelations($eventId) public function viewClusterRelations($eventId)
{ {
@ -4759,7 +4759,7 @@ class EventsController extends AppController
); );
$this->set('events', $this->paginate()); $this->set('events', $this->paginate());
$this->set('threatLevels', $this->Event->ThreatLevel->list()); $this->set('threatLevels', $this->Event->ThreatLevel->listThreatLevels());
$this->set('eventDescriptions', $this->Event->fieldDescriptions); $this->set('eventDescriptions', $this->Event->fieldDescriptions);
$this->set('analysisLevels', $this->Event->analysisLevels); $this->set('analysisLevels', $this->Event->analysisLevels);
$this->set('distributionLevels', $this->Event->distributionLevels); $this->set('distributionLevels', $this->Event->distributionLevels);

View File

@ -694,7 +694,7 @@ class FeedsController extends AppController
} }
$this->set('events', $events); $this->set('events', $events);
$this->loadModel('Event'); $this->loadModel('Event');
$this->set('threatLevels', $this->Event->ThreatLevel->list()); $this->set('threatLevels', $this->Event->ThreatLevel->listThreatLevels());
$this->set('eventDescriptions', $this->Event->fieldDescriptions); $this->set('eventDescriptions', $this->Event->fieldDescriptions);
$this->set('analysisLevels', $this->Event->analysisLevels); $this->set('analysisLevels', $this->Event->analysisLevels);
$this->set('distributionLevels', $this->Event->distributionLevels); $this->set('distributionLevels', $this->Event->distributionLevels);

View File

@ -124,7 +124,7 @@ class ServersController extends AppController
} }
$this->loadModel('Event'); $this->loadModel('Event');
$this->set('threatLevels', $this->Event->ThreatLevel->list()); $this->set('threatLevels', $this->Event->ThreatLevel->listThreatLevels());
App::uses('CustomPaginationTool', 'Tools'); App::uses('CustomPaginationTool', 'Tools');
$customPagination = new CustomPaginationTool(); $customPagination = new CustomPaginationTool();
$params = $customPagination->createPaginationRules($events, $this->passedArgs, $this->alias); $params = $customPagination->createPaginationRules($events, $this->passedArgs, $this->alias);
@ -202,7 +202,7 @@ class ServersController extends AppController
$this->set($alias, $currentModel->{$variable}); $this->set($alias, $currentModel->{$variable});
} }
} }
$this->set('threatLevels', $this->Event->ThreatLevel->list()); $this->set('threatLevels', $this->Event->ThreatLevel->listThreatLevels());
$this->set('title_for_layout', __('Remote event preview')); $this->set('title_for_layout', __('Remote event preview'));
} }

View File

@ -23,7 +23,7 @@ class ThreatLevel extends AppModel
), ),
); );
public function list() public function listThreatLevels()
{ {
return $this->find('list', [ return $this->find('list', [
'fields' => ['id', 'name'], 'fields' => ['id', 'name'],