chg: fix indention in some files

pull/1461/head
Andreas Ziegler 2016-08-22 03:40:17 +02:00
parent 99e6ae7946
commit fa8300adea
8 changed files with 43 additions and 43 deletions

View File

@ -113,7 +113,7 @@
* `manager_index()` and `/manager/controller/index`
*
*/
Configure::write('Routing.prefixes', array('admin'));
Configure::write('Routing.prefixes', array('admin'));
/**
* Turn off all caching application-wide.

View File

@ -83,11 +83,11 @@ class AppController extends Controller {
$this->loadModel('User');
$auth_user_fields = $this->User->describeAuthFields();
//if fresh installation (salt empty) generate a new salt
if (!Configure::read('Security.salt')) {
$this->loadModel('Server');
$this->Server->serverSettingsSaveValue('Security.salt', $this->User->generateRandomPassword(32));
}
//if fresh installation (salt empty) generate a new salt
if (!Configure::read('Security.salt')) {
$this->loadModel('Server');
$this->Server->serverSettingsSaveValue('Security.salt', $this->User->generateRandomPassword(32));
}
// check if Apache provides kerberos authentication data
$envvar = Configure::read('ApacheSecureAuth.apacheEnv');
if (isset($_SERVER[$envvar])) {

View File

@ -908,7 +908,7 @@ class AttributesController extends AppController {
* @throws MethodNotAllowedException
* @throws NotFoundException
* @return CakeResponse
*/
*/
public function restore($id = null) {
$attribute = $this->Attribute->find('first', array(
'conditions' => array('Attribute.id' => $id),

View File

@ -823,8 +823,8 @@ class Attribute extends AppModel {
case 'regkey|value':
case 'filename':
case 'pdb':
case 'windows-scheduled-task':
case 'whois-registrant-name':
case 'windows-scheduled-task':
case 'whois-registrant-name':
case 'whois-registrar':
case 'whois-creation-date':
// no newline

View File

@ -1519,7 +1519,7 @@ class Event extends AppModel {
} else {
$subject = '';
}
$tplColorString = !empty(Configure::read('MISP.email_subject_TLP_string')) ? Configure::read('MISP.email_subject_TLP_string') : "TLP Amber";
$tplColorString = !empty(Configure::read('MISP.email_subject_TLP_string')) ? Configure::read('MISP.email_subject_TLP_string') : "TLP Amber";
$subject = "[" . Configure::read('MISP.org') . " MISP] Event " . $id . " - " . $subject . $event[0]['ThreatLevel']['name'] . " - ".$tplColorString;
// Initialise the Job class if we have a background process ID
@ -1712,7 +1712,7 @@ class Event extends AppModel {
$bodyevent .= "\n";
$bodyevent .= $bodyTempOther; // append the 'other' attribute types to the bottom.
$result = true;
$tplColorString = !empty(Configure::read('MISP.email_subject_TLP_string')) ? Configure::read('MISP.email_subject_TLP_string') : "TLP Amber";
$tplColorString = !empty(Configure::read('MISP.email_subject_TLP_string')) ? Configure::read('MISP.email_subject_TLP_string') : "TLP Amber";
foreach ($orgMembers as &$reporter) {
$subject = "[" . Configure::read('MISP.org') . " MISP] Need info about event " . $id . " - ".$tplColorString;
$result = $this->User->sendEmail($reporter, $bodyevent, $body, $subject, $user) && $result;
@ -2631,7 +2631,7 @@ class Event extends AppModel {
$correlatedAttributes = isset($event['RelatedAttribute']) ? array_keys($event['RelatedAttribute']) : array();
$correlatedShadowAttributes = isset($event['RelatedShadowAttribute']) ? array_keys($event['RelatedShadowAttribute']) : array();
foreach ($event['Attribute'] as $attribute) {
if ($filterType && !in_array($filterType, array('proposal', 'correlation', 'warning'))) if (!in_array($attribute['type'], $this->Attribute->typeGroupings[$filterType])) continue;
if ($filterType && !in_array($filterType, array('proposal', 'correlation', 'warning'))) if (!in_array($attribute['type'], $this->Attribute->typeGroupings[$filterType])) continue;
if (isset($attribute['distribution']) && $attribute['distribution'] != 4) unset($attribute['SharingGroup']);
$attribute['objectType'] = 0;
if (!empty($attribute['ShadowAttribute'])) $attribute['hasChildren'] = 1;

View File

@ -2,7 +2,7 @@
App::uses('AppModel', 'Model');
class Organisation extends AppModel{
public $useTable = 'organisations';
public $recursive = -1;
public $recursive = -1;
public $actsAs = array(
'Containable',
'SysLogLogable.SysLogLogable' => array( // TODO Audit, logable
@ -22,11 +22,11 @@ class Organisation extends AppModel{
),
),
'uuid' => array(
'unique' => array(
'rule' => 'isUnique',
'message' => 'An organisation with this UUID already exists.',
'allowEmpty' => true
),
'unique' => array(
'rule' => 'isUnique',
'message' => 'An organisation with this UUID already exists.',
'allowEmpty' => true
),
'uuid' => array(
'rule' => array('uuid'),
'message' => 'Please provide a valid UUID',

View File

@ -26,13 +26,13 @@ class SysLog {
*
* @var string
*/
var $_ident = null;
var $_ident = null;
/**
* The facility to use for storing log files.
*
* @var string
*/
var $_facility = null;
var $_facility = null;
/**
* Constructs a new SysLog Logger.
*
@ -44,12 +44,12 @@ class SysLog {
* @param array $options Options for the SysLog, see above.
* @return void
*/
function SysLog($options = array()) {
$default_facility = LOG_LOCAL0;
$options += array('ident' => LOGS, 'facility' => $default_facility);
$this->_ident = $options['ident'];
$this->_facility = $options['facility'];
}
function SysLog($options = array()) {
$default_facility = LOG_LOCAL0;
$options += array('ident' => LOGS, 'facility' => $default_facility);
$this->_ident = $options['ident'];
$this->_facility = $options['facility'];
}
/**
* Implements writing to the specified syslog
@ -58,21 +58,21 @@ class SysLog {
* @param string $message The message you want to log.
* @return boolean success of write.
*/
function write($type, $message) {
$debugTypes = array('notice', 'info', 'debug');
$priority = LOG_INFO;
if ($type == 'error' || $type == 'warning') {
$priority = LOG_ERR;
} else if (in_array($type, $debugTypes)) {
$priority = LOG_DEBUG;
}
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n";
if (!openlog($this->_ident, LOG_PID | LOG_PERROR, $this->_facility)) {
return false;
}
$result = syslog($priority, $output);
closelog();
return $result;
}
function write($type, $message) {
$debugTypes = array('notice', 'info', 'debug');
$priority = LOG_INFO;
if ($type == 'error' || $type == 'warning') {
$priority = LOG_ERR;
} else if (in_array($type, $debugTypes)) {
$priority = LOG_DEBUG;
}
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n";
if (!openlog($this->_ident, LOG_PID | LOG_PERROR, $this->_facility)) {
return false;
}
$result = syslog($priority, $output);
closelog();
return $result;
}
}
?>

View File

@ -183,7 +183,7 @@ class SysLogLogableBehavior extends LogableBehavior {
}
break;
case "Event":
$title = 'Event ('. $Model->data[$Model->alias]['id'] .'): '. $Model->data[$Model->alias]['info'];
$title = 'Event ('. $Model->data[$Model->alias]['id'] .'): '. $Model->data[$Model->alias]['info'];
$logData['Log']['title'] = $title;
break;
case "Organisation":