mirror of https://github.com/MISP/MISP
fix: [sharingGroup:captureSharingGroup] Fix failing capture in case of
roaming mode - The server list check was incorrect - When capturing, roaming mode was always defaulted to false - The logs could not be written due to non-initialized classpull/6084/head
parent
e52b001c7c
commit
60a9707808
|
@ -269,7 +269,7 @@ class SharingGroup extends AppModel
|
|||
}
|
||||
}
|
||||
}
|
||||
if (isset($sg['SharingGroupServer'])) {
|
||||
if (!empty($sg['SharingGroupServer'])) {
|
||||
foreach ($sg['SharingGroupServer'] as $server) {
|
||||
if (isset($server['Server'][0])) {
|
||||
$server['Server'] = $server['Server'][0];
|
||||
|
@ -496,6 +496,7 @@ class SharingGroup extends AppModel
|
|||
|
||||
public function captureSG($sg, $user, $syncLocal=false)
|
||||
{
|
||||
$this->Log = ClassRegistry::init('Log');
|
||||
$existingSG = !isset($sg['uuid']) ? null : $this->find('first', array(
|
||||
'recursive' => -1,
|
||||
'conditions' => array('SharingGroup.uuid' => $sg['uuid']),
|
||||
|
@ -548,7 +549,8 @@ class SharingGroup extends AppModel
|
|||
'organisation_uuid' => array('default' => $user['Organisation']['uuid']),
|
||||
'created' => array('default' => $date = date('Y-m-d H:i:s')),
|
||||
'modified' => array('default' => $date = date('Y-m-d H:i:s')),
|
||||
'active' => array('default' => 1)
|
||||
'active' => array('default' => 1),
|
||||
'roaming' => array('default' => false),
|
||||
);
|
||||
foreach (array_keys($attributes) as $a) {
|
||||
if (isset($sg[$a])) {
|
||||
|
|
Loading…
Reference in New Issue