MISP/app/View/Attributes/xml/index.ctp

29 lines
1.0 KiB
PHP
Executable File

<?php
$xmlArray = array();
foreach ($attributes as $key => $attribute) {
// rearrange things to be compatible with the Xml::fromArray()
$attributes[$key] = $attributes[$key]['Attribute'];
// cleanup the array from things we do not want to expose
unset($attributes[$key]['Event']);
// hide the private field is we are not in sync mode
if ('true' != Configure::read('CyDefSIG.sync')) {
unset($attributes[$key]['private']);
}
}
// display the XML to the user
$xmlArray['response']['Attribute'] = $attributes;
$xmlObject = Xml::fromArray($xmlArray, array('format' => 'tags'));
echo $xmlObject->asXML();
?><!--
Please note that this XML page is a representation of the /attributes/index page.
Because the /attributes/index page is paginated you will have a limited number of results.
You can for example ask: /attributes/index/limit:999.xml to get the 999 first records.
(A maximum has been set to 9999)
To export all the attributes at once, with their events, use the export functionality.
-->