mirror of https://github.com/MISP/MISP
Fixed some background worker issues
- scheduled pulls would fail because of invalid user object passed - invalid permissions checks / org checks would cause the RPZ export to fail when using background workerspull/796/head
parent
a265553f71
commit
ba95648fa5
|
@ -123,10 +123,10 @@ class EventShell extends AppShell
|
|||
$values = $this->Attribute->rpz($user);
|
||||
$this->Job->saveField('progress', 80);
|
||||
$dir = new Folder(APP . DS . '/tmp/cached_exports/' . $extra);
|
||||
if ($isSiteAdmin) {
|
||||
if ($user['Role']['perm_site_admin']) {
|
||||
$file = new File($dir->pwd() . DS . 'misp.rpz.ADMIN.txt');
|
||||
} else {
|
||||
$file = new File($dir->pwd() . DS . 'misp.rpz.' . $org . '.txt');
|
||||
$file = new File($dir->pwd() . DS . 'misp.rpz.' . $user['Organisation']['name'] . '.txt');
|
||||
}
|
||||
App::uses('RPZExport', 'Export');
|
||||
$rpzExport = new RPZExport();
|
||||
|
|
|
@ -105,7 +105,7 @@ class ServerShell extends AppShell
|
|||
|
||||
App::uses('SyncTool', 'Tools');
|
||||
$syncTool = new SyncTool();
|
||||
$result = $this->Server->pull($user['User'], $server['Server']['id'], 'full', $server, $jobId);
|
||||
$result = $this->Server->pull($user, $server['Server']['id'], 'full', $server, $jobId);
|
||||
$this->Job->save(array(
|
||||
'id' => $jobId,
|
||||
'message' => 'Job done.',
|
||||
|
|
Loading…
Reference in New Issue