From c1eda1e04bca927752a3ea49b9a7432621ccfba5 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sat, 4 Jun 2016 01:54:19 +0200 Subject: [PATCH] remove single spaces after tabs --- INSTALL/setup/config.php | 2 +- app/Config/bootstrap.b.default.php | 12 ++--- app/Config/bootstrap.default.php | 12 ++--- app/Lib/Export/NidsExport.php | 2 +- app/Lib/Tools/ComplexTypeTool.php | 6 +-- app/Model/AppModel.php | 2 +- app/Model/Attribute.php | 54 +++++++++---------- app/Model/Event.php | 22 ++++---- .../models/behaviors/LogableBehavior.php | 4 +- app/View/Events/export.ctp | 4 +- app/View/Jobs/index.ctp | 4 +- app/View/Users/verify_certificate.ctp | 2 +- app/View/Users/verify_g_p_g.ctp | 4 +- app/webroot/css/main.css | 2 +- app/webroot/js/misp2.4.46.js | 2 +- travis/bootstrap.php | 12 ++--- 16 files changed, 73 insertions(+), 73 deletions(-) diff --git a/INSTALL/setup/config.php b/INSTALL/setup/config.php index daaf209de..44ef11a9d 100644 --- a/INSTALL/setup/config.php +++ b/INSTALL/setup/config.php @@ -83,7 +83,7 @@ $config['CakeResque'] = array( // Can be an // - absolute path, // - an relative path, that will be relative to - // app/tmp/logs folder + // app/tmp/logs folder // - a simple filename, file will be created inside app/tmp/logs 'log' => TMP . 'logs' . DS . 'resque-worker-error.log', diff --git a/app/Config/bootstrap.b.default.php b/app/Config/bootstrap.b.default.php index c24e6ee2b..ca30ed5b1 100644 --- a/app/Config/bootstrap.b.default.php +++ b/app/Config/bootstrap.b.default.php @@ -15,7 +15,7 @@ * * File storage engine. * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'File', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -28,7 +28,7 @@ * * APC (http://pecl.php.net/package/APC) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Apc', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -37,7 +37,7 @@ * * Xcache (http://xcache.lighttpd.net/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Xcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -48,7 +48,7 @@ * * Memcache (http://memcached.org/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Memcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -62,7 +62,7 @@ * * Wincache (http://php.net/wincache) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Wincache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -71,7 +71,7 @@ * * Redis (http://http://redis.io/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Redis', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] diff --git a/app/Config/bootstrap.default.php b/app/Config/bootstrap.default.php index 0c542b298..2ef5db9e1 100644 --- a/app/Config/bootstrap.default.php +++ b/app/Config/bootstrap.default.php @@ -15,7 +15,7 @@ * * File storage engine. * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'File', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -28,7 +28,7 @@ * * APC (http://pecl.php.net/package/APC) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Apc', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -37,7 +37,7 @@ * * Xcache (http://xcache.lighttpd.net/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Xcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -48,7 +48,7 @@ * * Memcache (http://memcached.org/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Memcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -62,7 +62,7 @@ * * Wincache (http://php.net/wincache) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Wincache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -71,7 +71,7 @@ * * Redis (http://http://redis.io/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Redis', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] diff --git a/app/Lib/Export/NidsExport.php b/app/Lib/Export/NidsExport.php index d3cd6deba..8bf5aaa15 100644 --- a/app/Lib/Export/NidsExport.php +++ b/app/Lib/Export/NidsExport.php @@ -14,7 +14,7 @@ class NidsExport { $this->rules[] = '# These NIDS rules contain some variables that need to exist in your configuration.'; $this->rules[] = '# Make sure you have set:'; $this->rules[] = '#'; - $this->rules[] = '# $HOME_NET - Your internal network range'; + $this->rules[] = '# $HOME_NET - Your internal network range'; $this->rules[] = '# $EXTERNAL_NET - The network considered as outside'; $this->rules[] = '# $SMTP_SERVERS - All your internal SMTP servers'; $this->rules[] = '# $HTTP_PORTS - The ports used to contain HTTP traffic (not required with suricata export)'; diff --git a/app/Lib/Tools/ComplexTypeTool.php b/app/Lib/Tools/ComplexTypeTool.php index 85ce9ce92..c6ec3a581 100644 --- a/app/Lib/Tools/ComplexTypeTool.php +++ b/app/Lib/Tools/ComplexTypeTool.php @@ -56,9 +56,9 @@ class ComplexTypeTool { $result = explode('.', $input); if (count($result) > 2) { $toReturn['multi'][] = array('type' => 'hostname', 'value' => $input); - $pos = strpos($input, '.'); - $toReturn['multi'][] = array('type' => 'domain', 'value' => substr($input, (1 + $pos))); - return $toReturn; + $pos = strpos($input, '.'); + $toReturn['multi'][] = array('type' => 'domain', 'value' => substr($input, (1 + $pos))); + return $toReturn; } return array('type' => 'domain', 'value' => $input); } diff --git a/app/Model/AppModel.php b/app/Model/AppModel.php index e1f38a2b4..b501cd6a8 100644 --- a/app/Model/AppModel.php +++ b/app/Model/AppModel.php @@ -292,7 +292,7 @@ class AppModel extends Model { `1_shadow_attribute_id` int(11) NOT NULL, `event_id` int(11) NOT NULL, `1_event_id` int(11) NOT NULL, - `info` text COLLATE utf8_bin NOT NULL, + `info` text COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), KEY `org_id` (`org_id`), KEY `attribute_id` (`attribute_id`), diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 89ddbeb92..4f868ec21 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -1360,7 +1360,7 @@ class Attribute extends AppModel { return $rules; } - public function text($user, $type, $tags = false, $eventId = false, $allowNonIDS = false, $from = false, $to = false, $last = false) { + public function text($user, $type, $tags = false, $eventId = false, $allowNonIDS = false, $from = false, $to = false, $last = false) { //restricting to non-private or same org if the user is not a site-admin. $conditions['AND'] = array(); if ($allowNonIDS === false) $conditions['AND'] = array('Attribute.to_ids =' => 1, 'Event.published =' => 1); @@ -1395,9 +1395,9 @@ class Attribute extends AppModel { 'fields' => array('Event.id', 'Event.published', 'Event.date', 'Event.publish_timestamp'), )))); return $attributes; - } + } - public function rpz($user, $tags = false, $eventId = false, $from = false, $to = false) { + public function rpz($user, $tags = false, $eventId = false, $from = false, $to = false) { // we can group hostname and domain as well as ip-src and ip-dst in this case $conditions['AND'] = array('Attribute.to_ids' => 1, 'Event.published' => 1); $typesToFetch = array('ip' => array('ip-src', 'ip-dst'), 'domain' => array('domain'), 'hostname' => array('hostname')); @@ -1455,9 +1455,9 @@ class Attribute extends AppModel { unset($temp); } return $values; - } + } - public function generateCorrelation($jobId = false, $startPercentage = 0) { + public function generateCorrelation($jobId = false, $startPercentage = 0) { $this->Correlation = ClassRegistry::init('Correlation'); $this->Correlation->deleteAll(array('id !=' => 0), false); // get all attributes.. @@ -1487,9 +1487,9 @@ class Attribute extends AppModel { } if ($jobId && Configure::read('MISP.background_jobs')) $this->Job->saveField('message', 'Job done.'); return $attributeCount; - } + } - public function reportValidationIssuesAttributes($eventId) { + public function reportValidationIssuesAttributes($eventId) { $conditions = array(); if ($eventId && is_numeric($eventId)) $conditions = array('event_id' => $eventId); @@ -1513,11 +1513,11 @@ class Attribute extends AppModel { } } return $result; - } + } - // This method takes a string from an argument with several elements (separated by '&&' and negated by '!') and returns 2 arrays - // array 1 will have all of the non negated terms and array 2 all the negated terms - public function dissectArgs($args) { + // This method takes a string from an argument with several elements (separated by '&&' and negated by '!') and returns 2 arrays + // array 1 will have all of the non negated terms and array 2 all the negated terms + public function dissectArgs($args) { if (!$args) return array(null, null); if (is_array($args)) { $argArray = $args; @@ -1536,24 +1536,24 @@ class Attribute extends AppModel { $result[0] = $accept; $result[1] = $reject; return $result; - } + } - public function checkForValidationIssues($attribute) { + public function checkForValidationIssues($attribute) { $this->set($attribute); if ($this->validates()) { return false; } else { return $this->validationErrors; } - } + } - public function checkTemplateAttributes($template, &$data, $event_id) { - $result = array(); - $errors = array(); - $attributes = array(); - if (isset($data['Template']['fileArray'])) $fileArray = json_decode($data['Template']['fileArray'], true); - foreach ($template['TemplateElement'] as $element) { + public function checkTemplateAttributes($template, &$data, $event_id) { + $result = array(); + $errors = array(); + $attributes = array(); + if (isset($data['Template']['fileArray'])) $fileArray = json_decode($data['Template']['fileArray'], true); + foreach ($template['TemplateElement'] as $element) { if ($element['element_definition'] == 'attribute') { $result = $this->__resolveElementAttribute($element['TemplateElementAttribute'][0], $data['Template']['value_' . $element['id']]); } else if ($element['element_definition'] == 'file') { @@ -1586,9 +1586,9 @@ class Attribute extends AppModel { } } } - } - return array('attributes' => $attributes, 'errors' => $errors); - } + } + return array('attributes' => $attributes, 'errors' => $errors); + } private function __resolveElementAttribute($element, $value) { @@ -1665,7 +1665,7 @@ class Attribute extends AppModel { return array('attributes' => $attributes, 'errors' => $errors, 'files' => $files); } - private function __createAttribute($element, $value) { + private function __createAttribute($element, $value) { $attribute = array( 'comment' => $element['name'], 'to_ids' => $element['to_ids'], @@ -1694,9 +1694,9 @@ class Attribute extends AppModel { $attribute['type'] = $element['type']; } return $attribute; - } + } - public function buildConditions($user) { + public function buildConditions($user) { $conditions = array(); if (!$user['Role']['perm_site_admin']) { $eventIds = $this->Event->fetchEventIds($user, false, false, false, true); @@ -1726,7 +1726,7 @@ class Attribute extends AppModel { ); } return $conditions; - } + } // Method that fetches all attributes for the various exports // very flexible, it's basically a replacement for find, with the addition that it restricts access based on user diff --git a/app/Model/Event.php b/app/Model/Event.php index dc22fed62..741d3145f 100644 --- a/app/Model/Event.php +++ b/app/Model/Event.php @@ -127,7 +127,7 @@ class Event extends AppModel { 'event_analysis' => array('object' => false, 'var' => 'analysis'), 'event_date' => array('object' => false, 'var' => 'date'), 'event_tag' => array('object' => 'Tag', 'var' => 'name') - ); + ); /** * Validation rules @@ -1457,9 +1457,9 @@ class Event extends AppModel { } } return $attributes; - } + } - private function attachEventInfoToAttributes($attributes, $user) { + private function attachEventInfoToAttributes($attributes, $user) { $TLs = $this->ThreatLevel->find('list', array( 'recursive' => -1, )); @@ -1506,9 +1506,9 @@ class Event extends AppModel { } } return $attributes; - } + } - public function sendAlertEmailRouter($id, $user) { + public function sendAlertEmailRouter($id, $user) { if (Configure::read('MISP.block_old_event_alert') && Configure::read('MISP.block_old_event_alert_age') && is_numeric(Configure::read('MISP.block_old_event_alert_age'))) { $oldest = time() - (Configure::read('MISP.block_old_event_alert_age') * 86400); $event = $this->find('first', array( @@ -1544,9 +1544,9 @@ class Event extends AppModel { } else { return ($this->sendAlertEmail($id, $user)); } - } + } - public function sendAlertEmail($id, $senderUser, $processId = null) { + public function sendAlertEmail($id, $senderUser, $processId = null) { $event = $this->fetchEvent($senderUser, array('eventid' => $id, 'includeAllTags' => true)); if (empty($event)) throw new MethodNotFoundException('Invalid Event.'); $userConditions = array('autoalert' => 1); @@ -1595,9 +1595,9 @@ class Event extends AppModel { $this->Job->saveField('message', 'Mails sent.'); } return true; - } + } - private function __buildAlertEmailBody($event, $user, $sgModel) { + private function __buildAlertEmailBody($event, $user, $sgModel) { $owner = false; if ($user['org_id'] == $event['Event']['orgc_id'] || $user['org_id'] == $event['Event']['org_id'] || $user['Role']['perm_site_admin']) $owner = true; // The mail body, h() is NOT needed as we are sending plain-text mails. @@ -1668,7 +1668,7 @@ class Event extends AppModel { $body .= $bodyTempOther; // append the 'other' attribute types to the bottom. $body .= '==============================================' . "\n"; return $body; - } + } public function sendContactEmail($id, $message, $creator_only, $user, $isSiteAdmin) { // fetch the event @@ -1888,7 +1888,7 @@ class Event extends AppModel { // Workaround for different structure in XML/array than what CakePHP expects $data = $this->cleanupEventArrayFromXML($data); // the event_id field is not set (normal) so make sure no validation errors are thrown - // LATER do this with $this->validator()->remove('event_id'); + // LATER do this with $this->validator()->remove('event_id'); unset($this->Attribute->validate['event_id']); // otherwise gives bugs because event_id is not set unset($this->Attribute->validate['value']['uniqueValue']); // unset this - we are saving a new event, there are no values to compare against and event_id is not set in the attributes } diff --git a/app/Plugin/Assets/models/behaviors/LogableBehavior.php b/app/Plugin/Assets/models/behaviors/LogableBehavior.php index bc23d74c8..faf1e680b 100644 --- a/app/Plugin/Assets/models/behaviors/LogableBehavior.php +++ b/app/Plugin/Assets/models/behaviors/LogableBehavior.php @@ -21,13 +21,13 @@ * or if u want more detail, add any combination of the following : * * - "model" [string] : automagically filled with the class name of the model that generated the activity. - * - "model_id" [int] : automagically filled with the primary key of the model that was modified. + * - "model_id" [int] : automagically filled with the primary key of the model that was modified. * - "action" [string] : automagically filled with what action is made (add/edit/delete) * - "user_id" [int] : populated with the supplied user info. (May be renamed. See bellow.) * - "change" [string] : depending on setting either : * [name (alek) => (Alek), age (28) => (29)] or [name, age] * - * - "version_id" [int] : cooperates with RevisionBehavior to link the shadow table (thus linking to old data) + * - "version_id" [int] : cooperates with RevisionBehavior to link the shadow table (thus linking to old data) * * Remember that Logable behavior needs to be added after RevisionBehavior. In fact, just put it last to be safe. * diff --git a/app/View/Events/export.ctp b/app/View/Events/export.ctp index b7c320218..622bd49aa 100644 --- a/app/View/Events/export.ctp +++ b/app/View/Events/export.ctp @@ -46,9 +46,9 @@
Loading...
diff --git a/app/View/Jobs/index.ctp b/app/View/Jobs/index.ctp index cd9567776..d609cec43 100644 --- a/app/View/Jobs/index.ctp +++ b/app/View/Jobs/index.ctp @@ -75,10 +75,10 @@
- 0 && $item['Job']['progress'] < 100) echo h($item['Job']['progress']) . '%'; if ($item['Job']['progress'] == 100) echo 'Completed.'; - ?> + ?>
diff --git a/app/View/Users/verify_certificate.ctp b/app/View/Users/verify_certificate.ctp index 0fd022b7b..13aace393 100755 --- a/app/View/Users/verify_certificate.ctp +++ b/app/View/Users/verify_certificate.ctp @@ -11,7 +11,7 @@ echo '------------------------------------------------------------------------------
'; } ?> - + element('side_menu', array('menuList' => 'admin', 'menuItem' => 'adminTools')); diff --git a/app/View/Users/verify_g_p_g.ctp b/app/View/Users/verify_g_p_g.ctp index a01e1d592..2e76f72ff 100644 --- a/app/View/Users/verify_g_p_g.ctp +++ b/app/View/Users/verify_g_p_g.ctp @@ -10,8 +10,8 @@ } echo '------------------------------------------------------------------------------
'; } - ?> - + ?> + element('side_menu', array('menuList' => 'admin', 'menuItem' => 'adminTools')); diff --git a/app/webroot/css/main.css b/app/webroot/css/main.css index 950e870a6..05f67f972 100644 --- a/app/webroot/css/main.css +++ b/app/webroot/css/main.css @@ -286,7 +286,7 @@ tr.highlightBlueBottom { } table.fullwidth { - border:1px solid #f0f0f0; + border:1px solid #f0f0f0; } table.fullwidth th, table.fullwidth th a { diff --git a/app/webroot/js/misp2.4.46.js b/app/webroot/js/misp2.4.46.js index 94368bd44..287d1e557 100644 --- a/app/webroot/js/misp2.4.46.js +++ b/app/webroot/js/misp2.4.46.js @@ -752,7 +752,7 @@ function saveValuesForPersistance() { function recoverValuesFromPersistance(formPersistanceArray) { for (i = 0; i < fieldsArray.length; i++) { - document.getElementById(fieldsArray[i]).value = formPersistanceArray[fieldsArray[i]]; + document.getElementById(fieldsArray[i]).value = formPersistanceArray[fieldsArray[i]]; } } diff --git a/travis/bootstrap.php b/travis/bootstrap.php index 0c093edbe..54aae30e2 100644 --- a/travis/bootstrap.php +++ b/travis/bootstrap.php @@ -15,7 +15,7 @@ * * File storage engine. * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'File', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -28,7 +28,7 @@ * * APC (http://pecl.php.net/package/APC) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Apc', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -37,7 +37,7 @@ * * Xcache (http://xcache.lighttpd.net/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Xcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -48,7 +48,7 @@ * * Memcache (http://memcached.org/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Memcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -62,7 +62,7 @@ * * Wincache (http://php.net/wincache) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Wincache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] @@ -71,7 +71,7 @@ * * Redis (http://http://redis.io/) * - * Cache::config('default', array( + * Cache::config('default', array( * 'engine' => 'Redis', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional]