2012-03-26 19:56:44 +02:00
<div class="attributes index">
2013-05-31 11:35:27 +02:00
<h2>Attributes</h2>
2012-12-17 17:21:57 +01:00
<?php
2012-12-18 20:25:12 +01:00
if ($isSearch == 1) {
echo "<h4>Results for all attributes";
2012-12-18 21:45:57 +01:00
if ($keywordSearch != null) echo " with the value containing \"<b>" . h($keywordSearch) . "</b>\"";
2013-06-24 13:24:08 +02:00
if ($keywordSearch2 != null) echo " from the events \"<b>" . h($keywordSearch2) . "</b>\"";
2012-12-18 21:45:57 +01:00
if ($categorySearch != "ALL") echo " of category \"<b>" . h($categorySearch) . "</b>\"";
if ($typeSearch != "ALL") echo " of type \"<b>" . h($typeSearch) . "</b>\"";
2013-03-19 11:54:14 +01:00
if (isset($orgSearch) && $orgSearch != '' && $orgSearch != null) echo " created by the organisation \"<b>" . h($orgSearch) . "</b>\"";
2012-12-18 20:25:12 +01:00
echo ":</h4>";
} ?>
2013-05-31 11:35:27 +02:00
<div class="pagination">
<ul>
<?php
$this->Paginator->options(array(
'update' => '.span12',
'evalScripts' => true,
'before' => '$(".progress").show()',
'complete' => '$(".progress").hide()',
));
echo $this->Paginator->prev('« ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
<table class="table table-striped table-hover table-condensed">
2012-03-15 15:06:45 +01:00
<tr>
<th><?php echo $this->Paginator->sort('event_id');?></th>
2014-02-05 15:22:42 +01:00
<?php if ('true' == Configure::read('MISP.showorg') || $isAdmin): ?>
<th><?php echo $this->Paginator->sort('orgc', 'Org');?></th>
<?php endif; ?>
2012-03-23 20:04:22 +01:00
<th><?php echo $this->Paginator->sort('category');?></th>
2012-03-15 15:06:45 +01:00
<th><?php echo $this->Paginator->sort('type');?></th>
<th><?php echo $this->Paginator->sort('value');?></th>
2013-10-30 16:00:46 +01:00
<th><?php echo $this->Paginator->sort('comment');?></th>
2012-09-19 11:05:10 +02:00
<th<?php echo ' title="' . $attrDescriptions['signature']['desc'] . '"';?>>
2013-06-27 14:28:54 +02:00
<?php echo $this->Paginator->sort('IDS');?></th>
2013-05-31 11:35:27 +02:00
<th class="actions">Actions</th>
2012-03-15 15:06:45 +01:00
</tr>
<?php
2013-01-29 13:33:07 +01:00
$currentCount = 0;
2013-05-29 14:19:36 +02:00
if ($isSearch == 1) {
2013-05-31 17:38:46 +02:00
// sanitize data
2013-06-28 14:28:58 +02:00
if (isset($keywordArray)) {
foreach ($keywordArray as &$keywordArrayElement) {
$keywordArrayElement = h($keywordArrayElement);
2013-06-07 12:40:40 +02:00
}
2013-05-31 17:38:46 +02:00
// build the $replacePairs variable used to highlight the keywords
$replacePairs = $this->Highlight->build_replace_pairs($keywordArray);
2013-06-28 14:28:58 +02:00
}
2013-05-29 14:19:36 +02:00
}
2013-03-18 11:48:36 +01:00
foreach ($attributes as $attribute):
?>
2012-03-15 15:06:45 +01:00
<tr>
2012-06-25 08:00:08 +02:00
<td class="short">
2013-07-03 10:46:24 +02:00
<div onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';">
2013-01-29 13:33:07 +01:00
<?php
2013-03-19 11:54:14 +01:00
if ($attribute['Event']['orgc'] == $me['org']) {
2014-02-05 15:22:42 +01:00
$style='style="color:red;"';
2013-03-19 11:54:14 +01:00
} else {
2014-02-05 15:22:42 +01:00
$style='';
2013-03-19 11:54:14 +01:00
}
2013-01-29 13:33:07 +01:00
$currentCount++;
?>
2014-02-05 15:22:42 +01:00
<a href="/events/view/<?php echo $attribute['Event']['id'];?>" <?php echo $style;?>><?php echo $attribute['Event']['id'];?></a>
2013-05-29 14:19:36 +02:00
</div>
2012-03-15 15:06:45 +01:00
</td>
2014-02-05 15:22:42 +01:00
<?php if ('true' == Configure::read('MISP.showorg') || $isAdmin): ?>
<td class="short" onclick="document.location.href ='/events/view/<?php echo $attribute['Event']['id'];?>'">
<?php
$imgRelativePath = 'orgs' . DS . h($attribute['Event']['orgc']) . '.png';
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath;
if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($attribute['Event']['orgc']) . '.png', array('alt' => h($attribute['Event']['orgc']), 'title' => h($attribute['Event']['orgc']), 'style' => 'width:24px; height:24px'));
else echo $this->Html->tag('span', h($attribute['Event']['orgc']), array('class' => 'welcome', 'style' => 'float:left;'));
?>
</td>
<?php endif;?>
2013-06-10 11:31:46 +02:00
<td title="<?php echo $categoryDefinitions[$attribute['Attribute']['category']]['desc'];?>" class="short" onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['category']; ?> </td>
<td title="<?php echo $typeDefinitions[$attribute['Attribute']['type']]['desc'];?>" class="short" onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['type']; ?> </td>
2013-06-19 11:05:34 +02:00
<td class="showspaces" onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';"><?php
2013-11-04 11:31:15 +01:00
$sigDisplay = nl2br(h($attribute['Attribute']['value']));
2013-06-19 11:05:34 +02:00
if ($isSearch == 1 && !empty($replacePairs)) {
// highlight the keywords if there are any
$sigDisplay = $this->Highlight->highlighter($sigDisplay, $replacePairs);
}
if ('attachment' == $attribute['Attribute']['type'] || 'malware-sample' == $attribute['Attribute']['type']) {
?><a href="/attributes/download/<?php echo $attribute['Attribute']['id'];?>"><?php echo $sigDisplay; ?></a><?php
} elseif ('link' == $attribute['Attribute']['type']) {
2013-07-03 11:21:04 +02:00
?><a href="<?php echo h($attribute['Attribute']['value']);?>"><?php echo $sigDisplay; ?></a><?php
2013-06-19 11:05:34 +02:00
} else {
echo $sigDisplay;
}
2013-10-30 16:00:46 +01:00
?>
</td>
<td onclick="document.location ='document.location ='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo h($attribute['Attribute']['comment']); ?>
</td>
2013-06-10 11:31:46 +02:00
<td class="short" onclick="document.location ='document.location ='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['to_ids'] ? 'Yes' : 'No'; ?>
</td>
2013-06-03 14:44:31 +02:00
<td class="short action-links"><?php
2012-12-18 20:25:12 +01:00
if ($isAdmin || ($isAclModify && $attribute['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $attribute['Event']['org'] == $me['org'])) {
2013-06-10 11:31:46 +02:00
?><a href="/attributes/edit/<?php echo $attribute['Attribute']['id'];?>" class="icon-edit" title="Edit"></a><?php
2013-05-30 11:14:00 +02:00
echo $this->Form->postLink('',array('action' => 'delete', $attribute['Attribute']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete this attribute?'));
2012-12-18 20:25:12 +01:00
}
?>
2013-06-10 11:31:46 +02:00
<a href="/events/view/<?php echo $attribute['Attribute']['event_id'];?>" class="icon-list-alt" title="View"></a>
2012-03-15 15:06:45 +01:00
</td>
</tr>
2012-12-18 20:25:12 +01:00
<?php
endforeach;
?>
2012-03-15 15:06:45 +01:00
</table>
2013-05-31 11:35:27 +02:00
2012-03-15 15:06:45 +01:00
<p>
2013-05-31 11:35:27 +02:00
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?>
</p>
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('« ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
2012-03-15 15:06:45 +01:00
</div>
2013-10-24 10:33:34 +02:00
<?php
if ($isSearch == 1){
$class = 'searchAttributes2';
} else {
$class = 'listAttributes';
}
?>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => $class));
?>
2013-06-06 16:36:28 +02:00
<script type="text/javascript">
// tooltips
$(document).ready(function () {
$("td, div").tooltip({
'placement': 'top',
'container' : 'body',
delay: { show: 500, hide: 100 }
});
});
2013-08-02 15:39:54 +02:00
</script>