data['Job']['id'])) { $this->data['Job']['date_created'] = $date; $this->data['Job']['date_modified'] = $date; } else { $this->data['Job']['date_modified'] = $date; } } public function cache($type, $user, $target, $jobOrg) { $extra = null; $extra2 = null; $shell = 'Event'; $this->create(); $data = array( 'worker' => 'cache', 'job_type' => 'cache_' . $type, 'job_input' => $target, 'status' => 0, 'retries' => 0, 'org' => $jobOrg, 'org_id' => $user['org_id'], 'message' => 'Fetching events.', ); if ($type === 'md5' || $type === 'sha1') { $extra = $type; $type = 'hids'; } if ($type === 'csv_all' || $type === 'csv_sig') { $extra = $type; $type = 'csv'; } if ($type === 'suricata' || $type === 'snort') { $extra = $type; $type = 'nids'; $extra2 = $user['nids_sid']; } if ($type === 'rpz') $extra = $type; $this->save($data); $id = $this->id; $process_id = CakeResque::enqueue( 'cache', $shell . 'Shell', array('cache' . $type, $user['id'], $id, $extra, $extra2), true ); $this->saveField('process_id', $process_id); return $id; } }