mirror of https://github.com/MISP/MISP
commit
0c7559ecb1
|
@ -407,8 +407,12 @@ class EventsController extends AppController {
|
||||||
'fields' => 'event_id',
|
'fields' => 'event_id',
|
||||||
'recursive' => -1,
|
'recursive' => -1,
|
||||||
));
|
));
|
||||||
foreach ($block as $b) {
|
if (!empty($block)) {
|
||||||
$this->paginate['conditions']['AND'][] = array('Event.id !=' => $b['EventTag']['event_id']);
|
$sqlSubQuery = 'Event.id NOT IN (';
|
||||||
|
foreach ($block as $b) {
|
||||||
|
$sqlSubQuery .= $b['EventTag']['event_id'] . ',';
|
||||||
|
}
|
||||||
|
$this->paginate['conditions']['AND'][] = substr($sqlSubQuery, 0, -1) . ')';
|
||||||
}
|
}
|
||||||
if ($filterString != "") $filterString .= "|";
|
if ($filterString != "") $filterString .= "|";
|
||||||
$filterString .= '!' . (isset($tagName['Tag']['name']) ? $tagName['Tag']['name'] : $piece);
|
$filterString .= '!' . (isset($tagName['Tag']['name']) ? $tagName['Tag']['name'] : $piece);
|
||||||
|
@ -438,10 +442,12 @@ class EventsController extends AppController {
|
||||||
'recursive' => -1,
|
'recursive' => -1,
|
||||||
));
|
));
|
||||||
if (!empty($allow)) {
|
if (!empty($allow)) {
|
||||||
|
$sqlSubQuery = 'Event.id IN (';
|
||||||
foreach ($allow as $a) {
|
foreach ($allow as $a) {
|
||||||
$setOR = true;
|
$setOR = true;
|
||||||
$this->paginate['conditions']['AND']['OR'][] = array('Event.id' => $a['EventTag']['event_id']);
|
$sqlSubQuery .= $a['EventTag']['event_id'] . ',';
|
||||||
}
|
}
|
||||||
|
$this->paginate['conditions']['AND']['OR'][] = substr($sqlSubQuery, 0, -1) . ')';
|
||||||
}
|
}
|
||||||
if ($filterString != "") $filterString .= "|";
|
if ($filterString != "") $filterString .= "|";
|
||||||
$filterString .= isset($tagName['Tag']['name']) ? $tagName['Tag']['name'] : $piece;
|
$filterString .= isset($tagName['Tag']['name']) ? $tagName['Tag']['name'] : $piece;
|
||||||
|
|
Loading…
Reference in New Issue