mirror of https://github.com/MISP/MISP
parent
c44bee0e96
commit
00dd47ef5e
|
@ -18,7 +18,7 @@ class ServersController extends AppController {
|
|||
'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 events
|
||||
'order' => array(
|
||||
'Server.url' => 'ASC'
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
public $uses = array('Server', 'Event');
|
||||
|
@ -43,11 +43,12 @@ class ServersController extends AppController {
|
|||
$this->Server->recursive = 0;
|
||||
if ($this->_isSiteAdmin()) {
|
||||
$this->paginate = array(
|
||||
'conditions' => array(),
|
||||
'conditions' => array(),
|
||||
'fields' => array('Server.*', 'Organisation.name', 'Organisation.id'),
|
||||
);
|
||||
} else {
|
||||
if (!$this->userRole['perm_sync'] && !$this->userRole['perm_admin']) $this->redirect(array('controller' => 'events', 'action' => 'index'));
|
||||
$conditions['Server.org LIKE'] = $this->Auth->user('org');
|
||||
$conditions['Server.org_id LIKE'] = $this->Auth->user('org_id');
|
||||
$this->paginate = array(
|
||||
'conditions' => array($conditions),
|
||||
);
|
||||
|
|
|
@ -13,6 +13,14 @@ class Server extends AppModel {
|
|||
'userKey' => 'user_id',
|
||||
'change' => 'full'
|
||||
), 'Trim');
|
||||
|
||||
public $belongsTo = array(
|
||||
'Organisation' => array(
|
||||
'className' => 'Organisation',
|
||||
'foreignKey' => 'org_id',
|
||||
//'conditions' => array('SharingGroupElement.organisation_uuid' => 'Organisation.uuid')
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Display field
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
</div>
|
||||
<table class="table table-striped table-hover table-condensed">
|
||||
<tr>
|
||||
<th><?php echo $this->Paginator->sort('name');?></th>
|
||||
<th><?php echo $this->Paginator->sort('push');?></th>
|
||||
<th><?php echo $this->Paginator->sort('pull');?></th>
|
||||
<th><?php echo $this->Paginator->sort('url');?></th>
|
||||
|
@ -32,13 +33,19 @@
|
|||
<?php
|
||||
foreach ($servers as $server): ?>
|
||||
<tr>
|
||||
<td class="short" style="text-align: center;"><?php echo ($server['Server']['push'])? 'Yes' : 'No'; ?> </td>
|
||||
<td class="short" style="text-align: center;"><?php echo ($server['Server']['pull'])? 'Yes' : 'No'; ?> </td>
|
||||
<td>
|
||||
<?php
|
||||
if (!empty($server['Server']['name'])) echo h($server['Server']['name']);
|
||||
else echo h($server['Server']['url']);
|
||||
?>
|
||||
</td>
|
||||
<td class="short"><span class="<?php echo ($server['Server']['push']? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
||||
<td class="short"><span class="<?php echo ($server['Server']['pull']? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
||||
<td><?php echo h($server['Server']['url']); ?> </td>
|
||||
<td><?php echo h($server['Server']['organization']); ?> </td>
|
||||
<td class="short"><?php echo h($server['Server']['cert_file']); ?> </td>
|
||||
<td class="short"><?php echo ($server['Server']['self_signed'] ? 'Yes' : 'No'); ?> </td>
|
||||
<td class="short"><?php echo h($server['Server']['org']); ?> </td>
|
||||
<td class="short"><span class="<?php echo ($server['Server']['self_signed'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
||||
<td class="short"><?php echo h($server['Organisation']['name']); ?> </td>
|
||||
<td class="short"><?php echo $server['Server']['lastpulledid']; ?></td>
|
||||
<td class="short"><?php echo $server['Server']['lastpushedid']; ?></td>
|
||||
<td class="short action-links">
|
||||
|
|
Loading…
Reference in New Issue