mirror of https://github.com/MISP/MISP
fix: Fixed missing publish flag in restsearch
parent
de98e8204f
commit
a8d6484893
|
@ -1519,7 +1519,7 @@ class AttributesController extends AppController {
|
||||||
// the last 4 fields accept the following operators:
|
// the last 4 fields accept the following operators:
|
||||||
// && - you can use && between two search values to put a logical OR between them. for value, 1.1.1.1&&2.2.2.2 would find attributes with the value being either of the two.
|
// && - you can use && between two search values to put a logical OR between them. for value, 1.1.1.1&&2.2.2.2 would find attributes with the value being either of the two.
|
||||||
// ! - you can negate a search term. For example: google.com&&!mail would search for all attributes with value google.com but not ones that include mail. www.google.com would get returned, mail.google.com wouldn't.
|
// ! - you can negate a search term. For example: google.com&&!mail would search for all attributes with value google.com but not ones that include mail. www.google.com would get returned, mail.google.com wouldn't.
|
||||||
public function restSearch($key='download', $value=false, $type=false, $category=false, $org=false, $tags=false, $from=false, $to=false, $last=false, $eventid=false, $withAttachments=false, $uuid=false, $publish_timestamp=false) {
|
public function restSearch($key = 'download', $value = false, $type = false, $category = false, $org = false, $tags = false, $from = false, $to = false, $last = false, $eventid = false, $withAttachments = false, $uuid = false, $publish_timestamp = false, $published = false) {
|
||||||
if ($tags) $tags = str_replace(';', ':', $tags);
|
if ($tags) $tags = str_replace(';', ':', $tags);
|
||||||
$simpleFalse = array('value' , 'type', 'category', 'org', 'tags', 'from', 'to', 'last', 'eventid', 'withAttachments', 'uuid', 'publish_timestamp');
|
$simpleFalse = array('value' , 'type', 'category', 'org', 'tags', 'from', 'to', 'last', 'eventid', 'withAttachments', 'uuid', 'publish_timestamp');
|
||||||
foreach ($simpleFalse as $sF) {
|
foreach ($simpleFalse as $sF) {
|
||||||
|
|
|
@ -2435,7 +2435,7 @@ class EventsController extends AppController {
|
||||||
// the last 4 fields accept the following operators:
|
// the last 4 fields accept the following operators:
|
||||||
// && - you can use && between two search values to put a logical OR between them. for value, 1.1.1.1&&2.2.2.2 would find attributes with the value being either of the two.
|
// && - you can use && between two search values to put a logical OR between them. for value, 1.1.1.1&&2.2.2.2 would find attributes with the value being either of the two.
|
||||||
// ! - you can negate a search term. For example: google.com&&!mail would search for all attributes with value google.com but not ones that include mail. www.google.com would get returned, mail.google.com wouldn't.
|
// ! - you can negate a search term. For example: google.com&&!mail would search for all attributes with value google.com but not ones that include mail. www.google.com would get returned, mail.google.com wouldn't.
|
||||||
public function restSearch($key = 'download', $value = false, $type = false, $category = false, $org = false, $tags = false, $searchall = false, $from = false, $to = false, $last = false, $eventid = false, $withAttachments = false, $metadata = false, $uuid = false, $publish_timestamp = false, $timestamp = false) {
|
public function restSearch($key = 'download', $value = false, $type = false, $category = false, $org = false, $tags = false, $searchall = false, $from = false, $to = false, $last = false, $eventid = false, $withAttachments = false, $metadata = false, $uuid = false, $publish_timestamp = false, $timestamp = false, $published = false) {
|
||||||
if ($key != 'download') {
|
if ($key != 'download') {
|
||||||
if (!$this->checkAuthUser($key)) {
|
if (!$this->checkAuthUser($key)) {
|
||||||
throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.');
|
throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.');
|
||||||
|
|
|
@ -1138,7 +1138,7 @@ class Event extends AppModel {
|
||||||
public function fetchEvent($user, $options = array()) {
|
public function fetchEvent($user, $options = array()) {
|
||||||
if (isset($options['Event.id'])) $options['eventid'] = $options['Event.id'];
|
if (isset($options['Event.id'])) $options['eventid'] = $options['Event.id'];
|
||||||
$possibleOptions = array('eventid', 'idList', 'tags', 'from', 'to', 'last', 'to_ids', 'includeAllTags', 'includeAttachments', 'event_uuid', 'distribution', 'sharing_group_id', 'disableSiteAdmin', 'metadata', 'includeGalaxy');
|
$possibleOptions = array('eventid', 'idList', 'tags', 'from', 'to', 'last', 'to_ids', 'includeAllTags', 'includeAttachments', 'event_uuid', 'distribution', 'sharing_group_id', 'disableSiteAdmin', 'metadata', 'includeGalaxy');
|
||||||
if (isset($options['includeGalaxy']) && $options['includeGalaxy']) {
|
if (!isset($options['excludeGalaxy']) || !$options['excludeGalaxy']) {
|
||||||
$this->GalaxyCluster = ClassRegistry::init('GalaxyCluster');
|
$this->GalaxyCluster = ClassRegistry::init('GalaxyCluster');
|
||||||
}
|
}
|
||||||
foreach ($possibleOptions as &$opt) if (!isset($options[$opt])) $options[$opt] = false;
|
foreach ($possibleOptions as &$opt) if (!isset($options[$opt])) $options[$opt] = false;
|
||||||
|
@ -1330,7 +1330,7 @@ class Event extends AppModel {
|
||||||
unset($event['EventTag'][$k]);
|
unset($event['EventTag'][$k]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isset($options['includeGalaxy']) && $options['includeGalaxy']) {
|
if (!isset($options['excludeGalaxy']) || !$options['excludeGalaxy']) {
|
||||||
if (substr($eventTag['Tag']['name'], 0, strlen('misp-galaxy:')) === 'misp-galaxy:') {
|
if (substr($eventTag['Tag']['name'], 0, strlen('misp-galaxy:')) === 'misp-galaxy:') {
|
||||||
$cluster = $this->GalaxyCluster->getCluster($eventTag['Tag']['name']);
|
$cluster = $this->GalaxyCluster->getCluster($eventTag['Tag']['name']);
|
||||||
if ($cluster) {
|
if ($cluster) {
|
||||||
|
|
Loading…
Reference in New Issue