Alternate event org display

- shows both orgc and org to normal users
- naming convention changed (orgc => source org, org => member org)
- this should allow users to see if an event was generated on their instance or not.
pull/375/head
iglocska 2014-11-25 13:21:25 +01:00
parent a599c650e1
commit 9fae7a2193
3 changed files with 58 additions and 24 deletions

View File

@ -373,6 +373,14 @@ class Server extends AppModel {
'test' => 'testForTermsFile',
'type' => 'string'
),
'showorgalternate' => array(
'level' => 2,
'description' => 'True enables the alternate org fields for the event index (source org and member org) instead of the traditional way of showing only an org field. This allows users to see if an event was uploaded by a member organisation on their MISP instance, or if it originated on an interconnected instance.',
'value' => '',
'errorMessage' => '',
'test' => 'testBool',
'type' => 'boolean'
),
),
'GnuPG' => array(
'branch' => 1,

View File

@ -46,16 +46,24 @@
<?php echo $this->Paginator->sort('published');?>
</th>
<?php
if (Configure::read('MISP.showorg') || $isAdmin): ?>
<th class="filter"><?php echo $this->Paginator->sort('org'); ?></th>
<?php
endif;
if (Configure::read('MISP.showorgalternate') && Configure::read('MISP.showorg')):
?>
<th class="filter"><?php echo $this->Paginator->sort('org', 'Source org'); ?></th>
<th class="filter"><?php echo $this->Paginator->sort('org', 'Member org'); ?></th>
<?php
else:
if (Configure::read('MISP.showorg') || $isAdmin):
?>
<th class="filter"><?php echo $this->Paginator->sort('org'); ?></th>
<?php
endif;
if ($isSiteAdmin):
?>
<th class="filter"><?php echo $this->Paginator->sort('owner org');?></th>
<?php
endif;
endif;
?>
<?php if ($isSiteAdmin): ?>
<th class="filter">
<?php echo $this->Paginator->sort('owner org');?>
</th>
<?php endif; ?>
<th><?php echo $this->Paginator->sort('id');?></th>
<?php if (Configure::read('MISP.tagging')): ?>
<th class="filter">Tags</th>
@ -101,7 +109,7 @@
&nbsp;
</td>
<?php endif;?>
<?php if ('true' == $isSiteAdmin): ?>
<?php if ($isSiteAdmin || (Configure::read('MISP.showorgalternate') && Configure::read('MISP.showorg'))): ?>
<td class="short" onclick="document.location.href ='/events/view/<?php echo $event['Event']['id'];?>'">
<?php
$imgRelativePath = 'orgs' . DS . h($event['Event']['org']) . '.png';

View File

@ -28,20 +28,38 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
<?php echo h($event['Event']['uuid']); ?>
&nbsp;
</dd>
<?php if (Configure::read('MISP.showorg') || $isAdmin): ?>
<dt>Org</dt>
<dd>
<?php echo h($event['Event']['orgc']); ?>
&nbsp;
</dd>
<?php endif; ?>
<?php if ($isSiteAdmin): ?>
<dt>Owner org</dt>
<dd>
<?php echo h($event['Event']['org']); ?>
&nbsp;
</dd>
<?php endif; ?>
<?php
if (Configure::read('MISP.showorgalternate') && (Configure::read('MISP.showorg') || $isAdmin)): ?>
<dt>Source Organisation</dt>
<dd>
<?php echo h($event['Event']['orgc']); ?>
&nbsp;
</dd>
<dt>Member Organisation</dt>
<dd>
<?php echo h($event['Event']['org']); ?>
&nbsp;
</dd>
<?php
else:
if (Configure::read('MISP.showorg') || $isAdmin): ?>
<dt>Org</dt>
<dd>
<?php echo h($event['Event']['orgc']); ?>
&nbsp;
</dd>
<?php endif; ?>
<?php if ($isSiteAdmin): ?>
<dt>Owner org</dt>
<dd>
<?php echo h($event['Event']['org']); ?>
&nbsp;
</dd>
<?php
endif;
endif;
?>
<dt>Contributors</dt>
<dd>
<?php