echo json_encode($data); exit; } if ($action == 'update_system' || $action == 'update_system_feed') { //Check system status $res = Av_center::get_task_status($system_id, 'alienvault-update'); if ($res['status'] == 'done') { if ($action == 'update_system') { $data = Av_center::update_av_system($system_id); } else { $data = Av_center::update_av_feed($system_id); } } elseif ($res['status'] == 'running') { $data['status'] = 'warning'; $data['data'] = _('Update process was launched previously'); } else { $data['status'] = 'warning'; $data['data'] = _('Update process can not be launched at this time. Please, try again later'); } } elseif ($action == 'check_update_status') { sleep(2); $res = Av_center::get_task_status($system_id, 'alienvault-update'); $data['status'] = 'success'; if ($res['status'] == 'running') { $data['data'] = 'sw_pkg_installing'; } else { $data['data'] = 'sw_pkg_pending'; } } echo json_encode($data); exit;
* * On Debian GNU/Linux systems, the complete text of the GNU General * Public License can be found in `/usr/share/common-licenses/GPL-2'. * * Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt * */ //Config File require_once dirname(__FILE__) . '/../../../config.inc'; $system_id = POST('system_id'); $action = POST('action'); ossim_valid($system_id, OSS_DIGIT, OSS_LETTER, '-', 'illegal:' . _('System ID')); ossim_valid($action, OSS_LETTER, '_', 'illegal:' . _('Action')); if (ossim_error()) { $config_nt = array('content' => ossim_get_error(), 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'margin: auto; width: 80%;'); $nt = new Notification('nt_1', $config_nt); $nt->show(); exit; } if ($action == 'check_reconfig_status') { sleep(1); $executing_reconfig = -1; //Check Reconfig status $reconfig = Av_center::get_task_status($system_id, 'alienvault-reconfig'); if ($reconfig['status'] == 'running') { $executing_reconfig = 1; } else { $executing_reconfig = 0; } echo $executing_reconfig; }