remove single spaces after tabs

pull/1206/head
Andreas Ziegler 2016-06-04 01:54:19 +02:00
parent 8a2352f7b8
commit c1eda1e04b
16 changed files with 73 additions and 73 deletions

View File

@ -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',

View File

@ -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]

View File

@ -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]

View File

@ -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)';

View File

@ -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);
}

View File

@ -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`),

View File

@ -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

View File

@ -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
}

View File

@ -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.
*

View File

@ -46,9 +46,9 @@
<td style="width:150px;">
<div id="barFrame<?php echo $i; ?>" class="progress progress-striped active" style="margin-bottom: 0px;display:none;">
<div id="bar<?php echo $i; ?>" class="bar" style="width: <?php echo $type['progress']; ?>%;">
<?php
<?php
if ($type['progress'] > 0 && $type['progress'] < 100) echo $type['progress'] . '%';
?>
?>
</div>
</div>
<div id="message<?php echo $i; ?>" style="text-align:center;display:block;">Loading...</div>

View File

@ -75,10 +75,10 @@
<td style="width:200px;">
<div class="progress progress-striped active" style="margin-bottom: 0px;">
<div id="bar<?php echo h($item['Job']['id']); ?>" class="bar" style="width: <?php echo h($item['Job']['progress']); ?>%;">
<?php
<?php
if ($item['Job']['progress'] > 0 && $item['Job']['progress'] < 100) echo h($item['Job']['progress']) . '%';
if ($item['Job']['progress'] == 100) echo 'Completed.';
?>
?>
</div>
</div>
<?php if ($item['Job']['progress'] != 100): ?>

View File

@ -11,7 +11,7 @@
echo '------------------------------------------------------------------------------<br />';
}
?>
</ul>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'adminTools'));

View File

@ -10,8 +10,8 @@
}
echo '------------------------------------------------------------------------------<br />';
}
?>
</ul>
?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'adminTools'));

View File

@ -286,7 +286,7 @@ tr.highlightBlueBottom {
}
table.fullwidth {
border:1px solid #f0f0f0;
border:1px solid #f0f0f0;
}
table.fullwidth th, table.fullwidth th a {

View File

@ -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]];
}
}

View File

@ -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]