mirror of https://github.com/MISP/MISP
Merge branch 'develop' of https://github.com/MISP/MISP into develop
commit
7486f478e0
|
@ -405,7 +405,7 @@ class NidsExportComponent extends Component {
|
|||
foreach ($explodedNames as &$explodedName) {
|
||||
// count the lenght of the part, and add |length| before
|
||||
$length = strlen($explodedName);
|
||||
if ($length > 255) exit('ERROR: dns name is to long for RFC'); // LATER log correctly without dying
|
||||
if ($length > 255) $this->log('WARNING: dns name is to long for RFC: '.$name);
|
||||
$hexLength = dechex($length);
|
||||
if (1 == strlen($hexLength)) $hexLength = '0' . $hexLength;
|
||||
$rawName .= '|' . $hexLength . '|' . $explodedName;
|
||||
|
|
|
@ -1468,6 +1468,7 @@ class EventsController extends AppController {
|
|||
'recursive' => 0, //int
|
||||
'group' => array('Attribute.type', 'Attribute.value1'), //fields to GROUP BY
|
||||
);
|
||||
unset($this->Attribute->virtualFields['category_order']); // not needed for IDS export and speeds things up
|
||||
$items = $this->Attribute->find('all', $params);
|
||||
|
||||
$rules = $this->NidsExport->export($items, $user['User']['nids_sid']);
|
||||
|
|
|
@ -431,11 +431,11 @@ class UsersController extends AppController {
|
|||
|
||||
// What org posted what type of attribute
|
||||
$this->loadModel('Attribute');
|
||||
$fields = array('Event.org', 'Attribute.type', 'count(Attribute.type) as `num_types`');
|
||||
$fields = array('Event.orgc', 'Attribute.type', 'count(Attribute.type) as `num_types`');
|
||||
$params = array('recursive' => 0,
|
||||
'fields' => $fields,
|
||||
'group' => array('Attribute.type', 'Event.org'),
|
||||
'order' => array('Event.org', 'num_types DESC'),
|
||||
'order' => array('Event.orgc', 'num_types DESC'),
|
||||
);
|
||||
$typesHistogram = $this->Attribute->find('all', $params);
|
||||
$this->set('typesHistogram', $typesHistogram);
|
||||
|
@ -456,11 +456,11 @@ class UsersController extends AppController {
|
|||
$prevRowOrg = "";
|
||||
$i = -1;
|
||||
foreach ($typesHistogram as &$row) {
|
||||
if ($prevRowOrg != $row['Event']['org']) {
|
||||
if ($prevRowOrg != $row['Event']['orgc']) {
|
||||
$i++;
|
||||
$graphData[] = "";
|
||||
$prevRowOrg = $row['Event']['org'];
|
||||
$graphData[$i] .= "org: '" . $row['Event']['org'] . "'";
|
||||
$prevRowOrg = $row['Event']['orgc'];
|
||||
$graphData[$i] .= "org: '" . $row['Event']['orgc'] . "'";
|
||||
}
|
||||
$graphData[$i] .= ', ' . str_replace($replace, "_", $row['Attribute']['type']) . ': ' . $row[0]['num_types'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue