Merge branch '2.4' into develop

pull/8053/head
iglocska 2021-12-22 13:12:25 +01:00
commit 5acc615f4d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 6 additions and 2 deletions

View File

@ -4312,12 +4312,16 @@ class Event extends AppModel
// If the distribution is sharing group only, check if the sync user is in the sharing group or not, return true if yes, false if no
public function checkDistributionForPush($object, $server, $context = 'Event')
{
$model = $context
if ($context === 'Sighting') {
$model = 'Event'
}
if (empty(Configure::read('MISP.host_org_id')) || !$server['Server']['internal'] || Configure::read('MISP.host_org_id') != $server['Server']['remote_org_id']) {
if ($context != 'Sighting' && $object[$context]['distribution'] < 2) {
if ($context != 'Sighting' && $object[$model]['distribution'] < 2) {
return false;
}
}
if ($object[$context]['distribution'] == 4) {
if ($object[$model]['distribution'] == 4) {
if ($context === 'Event' || $context === 'Sighting') {
return $this->SharingGroup->checkIfServerInSG($object['SharingGroup'], $server);
} else {