mirror of https://github.com/MISP/MISP
fix: [galaxy] GalaxyClusterRelation doesn't have Org and Orgc
parent
7b3be9362b
commit
170ea2c64d
|
@ -4669,8 +4669,7 @@ class EventsController extends AppController
|
|||
$this->loadModel('GalaxyCluster');
|
||||
$clusters = $this->GalaxyCluster->fetchGalaxyClusters($this->Auth->user(), array('conditions' => array('GalaxyCluster.id' => $clusterIds)), $full=true);
|
||||
App::uses('ClusterRelationsGraphTool', 'Tools');
|
||||
$grapher = new ClusterRelationsGraphTool();
|
||||
$grapher->construct($this->Auth->user(), $this->GalaxyCluster);
|
||||
$grapher = new ClusterRelationsGraphTool($this->Auth->user(), $this->GalaxyCluster);
|
||||
$relations = $grapher->getNetwork($clusters, $keepNotLinkedClusters=true, $includeReferencingRelation=true);
|
||||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->viewData($relations, $this->response->type());
|
||||
|
|
|
@ -586,8 +586,7 @@ class GalaxiesController extends AppController
|
|||
'conditions' => array('Galaxy.id' => $galaxyId)
|
||||
));
|
||||
App::uses('ClusterRelationsGraphTool', 'Tools');
|
||||
$grapher = new ClusterRelationsGraphTool();
|
||||
$grapher->construct($this->Auth->user(), $this->Galaxy->GalaxyCluster);
|
||||
$grapher = new ClusterRelationsGraphTool($this->Auth->user(), $this->Galaxy->GalaxyCluster);
|
||||
$relations = $grapher->getNetwork($clusters);
|
||||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->viewData($relations, $this->response->type());
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
<?php
|
||||
class ClusterRelationsGraphTool
|
||||
{
|
||||
private $GalaxyCluster = false;
|
||||
private $user = false;
|
||||
private $GalaxyCluster;
|
||||
private $user;
|
||||
private $lookup = array();
|
||||
|
||||
public function construct($user, $GalaxyCluster)
|
||||
public function __construct(array $user, GalaxyCluster $GalaxyCluster)
|
||||
{
|
||||
$this->GalaxyCluster = $GalaxyCluster;
|
||||
$this->user = $user;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +74,7 @@
|
|||
'conditions' => array(
|
||||
'referenced_galaxy_cluster_uuid' => $cluster['GalaxyCluster']['uuid']
|
||||
),
|
||||
'contain' => array('Org', 'Orgc', 'SharingGroup'),
|
||||
'contain' => array('SharingGroup'),
|
||||
));
|
||||
if (!empty($referencingRelations)) {
|
||||
foreach ($referencingRelations as $relation) {
|
||||
|
|
Loading…
Reference in New Issue