mirror of https://github.com/MISP/MISP
chg: [internal] Be sure that authorizedIds methods returns int
parent
d0fdf4c56f
commit
029ce6fb77
|
@ -482,6 +482,7 @@ class SharingGroup extends AppModel
|
|||
$sgids = $this->find('column', [
|
||||
'fields' => ['id'],
|
||||
]);
|
||||
$sgids = array_map('intval', $sgids);
|
||||
} else {
|
||||
$sgids = array_unique(array_merge(
|
||||
$this->SharingGroupServer->fetchAllAuthorised(),
|
||||
|
|
|
@ -84,7 +84,7 @@ class SharingGroupOrg extends AppModel
|
|||
* Returns sharing groups IDs that are accessible by given organisation ID.
|
||||
*
|
||||
* @param int $org_id
|
||||
* @return array
|
||||
* @return int[]
|
||||
*/
|
||||
public function fetchAllAuthorised($org_id)
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ class SharingGroupOrg extends AppModel
|
|||
'conditions' => array('org_id' => $org_id),
|
||||
'fields' => array('SharingGroupOrg.sharing_group_id'),
|
||||
));
|
||||
return $sgs;
|
||||
return array_map('intval', $sgs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,15 +83,18 @@ class SharingGroupServer extends AppModel
|
|||
}
|
||||
}
|
||||
|
||||
// returns all sharing group IDs that have the local server (server_id = 0) as a server object with all orgs turned to 1
|
||||
// This basically lists all SGs that allow everyone on the instance to see events tagged with it
|
||||
/**
|
||||
* Returns all sharing group IDs that have the local server (server_id = 0) as a server object with all orgs turned to 1
|
||||
* This basically lists all SGs that allow everyone on the instance to see events tagged with it
|
||||
* @return int[]
|
||||
*/
|
||||
public function fetchAllAuthorised()
|
||||
{
|
||||
$sgs = $this->find('column', array(
|
||||
'conditions' => array('all_orgs' => 1, 'server_id' => 0),
|
||||
'fields' => array('SharingGroupServer.sharing_group_id'),
|
||||
));
|
||||
return $sgs;
|
||||
return array_map('intval', $sgs);
|
||||
}
|
||||
|
||||
// pass a sharing group ID, returns true if it has the local server object attached with "all_orgs" set
|
||||
|
|
Loading…
Reference in New Issue