mirror of https://github.com/MISP/MISP
Fix to the initial version of the correlation on the event index
- also removed an expensive lookup of sharing group permissions required for event views utilising the pagination from being run on actions that do not make use of itpull/903/head
parent
12e32d4673
commit
3560b3bc06
|
@ -425,12 +425,12 @@ class Event extends AppModel {
|
|||
$eventIds = Set::extract('/Event/id', $events);
|
||||
$conditionsCorrelation = $this->__buildEventConditionsCorrelation($user, $eventIds, $sgids);
|
||||
$correlations = $this->Correlation->find('all',array(
|
||||
'fields' => array('Correlation.event_id', 'count(distinct(Correlation.1_event_id)) as count'),
|
||||
'fields' => array('Correlation.1_event_id', 'count(distinct(Correlation.event_id)) as count'),
|
||||
'conditions' => $conditionsCorrelation,
|
||||
'recursive' => -1,
|
||||
'group' => array('Correlation.event_id'),
|
||||
'group' => array('Correlation.1_event_id'),
|
||||
));
|
||||
$correlations = Hash::combine($correlations, '{n}.Correlation.event_id', '{n}.0.count');
|
||||
$correlations = Hash::combine($correlations, '{n}.Correlation.1_event_id', '{n}.0.count');
|
||||
foreach ($events as &$event) $event['Event']['correlation_count'] = (isset($correlations[$event['Event']['id']])) ? $correlations[$event['Event']['id']] : 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue