mirror of https://github.com/MISP/MISP
chg: [controller] Use standard way how to close sessions
parent
46b423aaef
commit
f44c1b379e
|
@ -209,15 +209,13 @@ class AuditLogsController extends AppController
|
|||
|
||||
public function returnDates($org = 'all')
|
||||
{
|
||||
if (!$this->Auth->user('Role')['perm_sharing_group'] && !empty(Configure::read('Security.hide_organisation_index_from_users'))) {
|
||||
if ($org !== 'all' && $org !== $this->Auth->user('Organisation')['name']) {
|
||||
$user = $this->_closeSession();
|
||||
if (!$user['Role']['perm_sharing_group'] && !empty(Configure::read('Security.hide_organisation_index_from_users'))) {
|
||||
if ($org !== 'all' && $org !== $user['Organisation']['name']) {
|
||||
throw new MethodNotAllowedException('Invalid organisation.');
|
||||
}
|
||||
}
|
||||
|
||||
// Fetching dates can be slow, so to allow concurrent requests, we can close sessions to release session lock
|
||||
session_write_close();
|
||||
|
||||
$data = $this->AuditLog->returnDates($org);
|
||||
return $this->RestResponse->viewData($data, $this->response->type());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue