Merge branch 'hotfix-2.2.14' into develop

pull/274/head
iglocska 2014-03-14 09:22:19 +01:00
commit 4b04616467
2 changed files with 13 additions and 4 deletions

View File

@ -141,6 +141,8 @@ Configure::write('MISP.default_attribute_distribution', 'event');
// Enable the tagging feature, it shou
Configure::write('MISP.tagging', true);
// enabling this flag will allow the event description to be transmitted in the alert e-mail's subject. Be aware that this is not encrypted by PGP, so only enable it if you accept that part of the event description will be sent out in clear-text
Configure::write('MISP.extended_alert_subject', false);
/**
* The settings below can be used to set additional paths to models, views and controllers.

View File

@ -1119,9 +1119,16 @@ class Event extends AppModel {
if (!empty($bodyTempOther)) {
$body .= "\n";
}
$subject = preg_replace( "/\r|\n/", "", $event['Event']['info']);
if (strlen($subject) > 55) {
$subject = substr($subject, 0, 55) . '...';
if (Configure::read('MISP.extended_alert_subject')) {
$subject = preg_replace( "/\r|\n/", "", $event['Event']['info']);
if (strlen($subject) > 55) {
$subject = substr($subject, 0, 55) . '... - ';
} else {
$subject .= " - ";
}
} else {
$subject = '';
}
$body .= $bodyTempOther; // append the 'other' attribute types to the bottom.
$body .= '==============================================' . "\n";
@ -1157,7 +1164,7 @@ class Event extends AppModel {
$Email = new CakeEmail();
$Email->from(Configure::read('MISP.email'));
$Email->to($user['User']['email']);
$Email->subject("[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Event " . $id . " - " . $subject . " - " . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->subject("[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Event " . $id . " - " . $subject . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->emailFormat('text'); // both text or html
// send it
$Email->send($bodySigned);