diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index 3cc506c16..5676081c6 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -3280,41 +3280,40 @@ class EventsController extends AppController public function proposalEventIndex() { $this->loadModel('ShadowAttribute'); - $this->ShadowAttribute->recursive = -1; $conditions = array('ShadowAttribute.deleted' => 0); if (!$this->_isSiteAdmin()) { $conditions[] = array('ShadowAttribute.event_org_id' => $this->Auth->user('org_id')); } - $result = $this->ShadowAttribute->find('all', array( - 'fields' => array('event_id'), - 'group' => array('event_id', 'id'), - 'conditions' => $conditions - )); + $result = $this->ShadowAttribute->find('column', [ + 'fields' => ['event_id'], + 'conditions' => $conditions, + 'unique' => true, + ]); $this->Event->recursive = -1; - $conditions = array(); - foreach ($result as $eventId) { - $conditions['OR'][] = array('Event.id =' => $eventId['ShadowAttribute']['event_id']); - } + if (empty($result)) { - $conditions['OR'][] = array('Event.id =' => -1); + $conditions = array('Event.id' => -1); + } else { + $conditions = array('Event.id' => $result); } $this->paginate = array( - 'fields' => array('Event.id', 'Event.org_id', 'Event.orgc_id', 'Event.publish_timestamp', 'Event.distribution', 'Event.info', 'Event.date', 'Event.published'), - 'conditions' => $conditions, - 'contain' => array( - 'User' => array( - 'fields' => array( - 'User.email' - )), - 'ShadowAttribute'=> array( - 'fields' => array( - 'ShadowAttribute.id', 'ShadowAttribute.org_id', 'ShadowAttribute.event_id' - ), - 'conditions' => array( - 'ShadowAttribute.deleted' => 0 - ), + 'fields' => array('Event.id', 'Event.org_id', 'Event.orgc_id', 'Event.publish_timestamp', 'Event.distribution', 'Event.info', 'Event.date', 'Event.published'), + 'conditions' => $conditions, + 'contain' => array( + 'User' => array( + 'fields' => array( + 'User.email' + )), + 'ShadowAttribute'=> array( + 'fields' => array( + 'ShadowAttribute.id', 'ShadowAttribute.org_id', 'ShadowAttribute.event_id' ), - )); + 'conditions' => array( + 'ShadowAttribute.deleted' => 0 + ), + ), + ) + ); $events = $this->paginate(); $orgIds = array(); foreach ($events as $k => $event) { @@ -5455,10 +5454,10 @@ class EventsController extends AppController $editors = array_unique($editors); if ($event['Event']['timestamp'] > $timestamp && empty($editors)) { - $message = __('Warning: This event view is outdated. Please reload page to see latest changes.'); + $message = __('Warning: This event view is outdated. Please reload page to see latest changes.'); $this->set('class', 'alert'); } else if ($event['Event']['timestamp'] > $timestamp) { - $message = __('Warning: This event view is outdated, because is currently being edited by: %s. Please reload page to see latest changes.', h(implode(', ', $editors))); + $message = __('Warning: This event view is outdated, because is currently being edited by: %s. Please reload page to see latest changes.', h(implode(', ', $editors))); $this->set('class', 'alert'); } else if (empty($editors)) { return new CakeResponse(['status' => 204]); diff --git a/app/View/Events/proposal_event_index.ctp b/app/View/Events/proposal_event_index.ctp index a8b983a9f..36e9cb6c1 100755 --- a/app/View/Events/proposal_event_index.ctp +++ b/app/View/Events/proposal_event_index.ctp @@ -1,5 +1,5 @@
-

+

-element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'viewProposalIndex')); +element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'viewProposalIndex')); diff --git a/app/files/feed-metadata/defaults.json b/app/files/feed-metadata/defaults.json index 4c16df1e4..89a16b8ef 100644 --- a/app/files/feed-metadata/defaults.json +++ b/app/files/feed-metadata/defaults.json @@ -3,7 +3,7 @@ "Feed": { "name": "CIRCL OSINT Feed", "provider": "CIRCL", - "url": "https://www.circl.lu/doc/misp/feed-osint", + "url": "https://www.circl.lu/doc/misp/feed-osint/", "rules": "{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]}}", "enabled": true, "distribution": "3",