diff --git a/app/Config/routes.php b/app/Config/routes.php index 2d5dce530..0b52e108f 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -37,6 +37,7 @@ Router::connect('/users/admin_index/*', array('controller' => 'users', 'action' => 'index', 'admin' => true)); Router::connect('/roles/admin_index/*', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); + Router::connect('/logs/admin_search/*', array('controller' => 'logs', 'action' => 'search', 'admin' => true)); // Router::connect('/roles/admin_add/*', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); // Router::connect('/roles/admin_edit/*', array('controller' => 'roles', 'action' => 'edit', 'admin' => true)); Router::connect('/logs/admin_index/*', array('controller' => 'logs', 'action' => 'index', 'admin' => true)); diff --git a/app/Controller/AttributesController.php b/app/Controller/AttributesController.php index d4a33b468..148df2598 100755 --- a/app/Controller/AttributesController.php +++ b/app/Controller/AttributesController.php @@ -638,7 +638,6 @@ class AttributesController extends AppController { $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); // reset the paginate_conditions $this->Session->write('paginate_conditions',array()); - if ($this->request->is('post') && ($this->request->here == $fullAddress)) { $keyword = $this->request->data['Attribute']['keyword']; $keyword2 = $this->request->data['Attribute']['keyword2']; @@ -722,7 +721,7 @@ class AttributesController extends AppController { $conditions['Attribute.category ='] = $category; } // organisation search field - $i = 0; + $i = 1; $temp = array(); if (isset($org)) { $orgArray = explode("\n", $org); @@ -765,9 +764,10 @@ class AttributesController extends AppController { $attributeIdList = array(); $attributes = $this->paginate(); // if we searched for IOCs only, apply the whitelist to the search result! + if ($ioc) { $this->loadModel('Whitelist'); - $attributes = $this->Whitelist->removeWhitelistedFromAttributeArray($attributes); + $attributes = $this->Whitelist->removeWhitelistedFromArray($attributes, true); } foreach ($attributes as &$attribute) { @@ -781,6 +781,8 @@ class AttributesController extends AppController { // and store into session $this->Session->write('paginate_conditions', $this->paginate); $this->Session->write('paginate_conditions_keyword', $keyword); + $this->Session->write('paginate_conditions_keyword2', $keyword2); + $this->Session->write('paginate_conditions_org', $org); $this->Session->write('paginate_conditions_type', $type); $this->Session->write('paginate_conditions_category', $category); $this->Session->write('search_find_idlist', $idList); @@ -810,9 +812,13 @@ class AttributesController extends AppController { // get from Session $keyword = $this->Session->read('paginate_conditions_keyword'); + $keyword2 = $this->Session->read('paginate_conditions_keyword2'); + $org = $this->Session->read('paginate_conditions_org'); $type = $this->Session->read('paginate_conditions_type'); $category = $this->Session->read('paginate_conditions_category'); $this->set('keywordSearch', $keyword); + $this->set('keywordSearch2', $keyword2); + $this->set('orgSearch', $org); $this->set('typeSearch', $type); $this->set('isSearch', 1); $this->set('categorySearch', $category); diff --git a/app/View/Attributes/index.ctp b/app/View/Attributes/index.ctp index 84f0aac3c..b0748b61e 100755 --- a/app/View/Attributes/index.ctp +++ b/app/View/Attributes/index.ctp @@ -41,11 +41,13 @@ if ($isSearch == 1) { if ($isSearch == 1) { // sanitize data - foreach ($keywordArray as &$keywordArrayElement) { - $keywordArrayElement = h($keywordArrayElement); - } + if (isset($keywordArray)) { + foreach ($keywordArray as &$keywordArrayElement) { + $keywordArrayElement = h($keywordArrayElement); + } // build the $replacePairs variable used to highlight the keywords $replacePairs = $this->Highlight->build_replace_pairs($keywordArray); + } } foreach ($attributes as $attribute): diff --git a/app/View/Users/admin_add.ctp b/app/View/Users/admin_add.ctp index b7ad4dbc6..b69599248 100644 --- a/app/View/Users/admin_add.ctp +++ b/app/View/Users/admin_add.ctp @@ -23,16 +23,16 @@
\ No newline at end of file diff --git a/app/View/Users/memberslist.ctp b/app/View/Users/memberslist.ctp index 78bc38fbf..a0b62112f 100755 --- a/app/View/Users/memberslist.ctp +++ b/app/View/Users/memberslist.ctp @@ -112,10 +112,10 @@ endforeach; ?>
diff --git a/app/View/Users/news.ctp b/app/View/Users/news.ctp index 383ff4782..343a11239 100755 --- a/app/View/Users/news.ctp +++ b/app/View/Users/news.ctp @@ -75,11 +75,11 @@ A bug in the DNS attributes has been corrected.

diff --git a/app/View/Users/terms.ctp b/app/View/Users/terms.ctp index 255debf4e..a8881a52f 100644 --- a/app/View/Users/terms.ctp +++ b/app/View/Users/terms.ctp @@ -11,10 +11,10 @@ if (!$termsaccepted) {
\ No newline at end of file diff --git a/app/View/Users/view.ctp b/app/View/Users/view.ctp index 499ea5927..643c8dbea 100755 --- a/app/View/Users/view.ctp +++ b/app/View/Users/view.ctp @@ -70,11 +70,11 @@ if (h($user['User']['gpgkey']) != 0) { -
  • Html->link(__('News', true), array('controller' => 'users', 'action' => 'news')); ?>
  • -
  • Html->link(__('My Profile', true), array('controller' => 'users', 'action' => 'view', 'me')); ?>
  • -
  • Html->link(__('Members List', true), array('controller' => 'users', 'action' => 'memberslist')); ?>
  • -
  • Html->link(__('User Guide', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?>
  • -
  • Html->link(__('Terms & Conditions', true), array('controller' => 'users', 'action' => 'terms')); ?>
  • +
  • News
  • +
  • My Profile
  • +
  • Members List
  • +
  • User Guide
  • +
  • Terms & Conditions