$num_rows = POST('num_rows') == '' ? 50 : POST('num_rows'); $profiles = empty($_POST['profiles']) ? array() : array_flip(explode(',', $_POST['profiles'])); ossim_valid($system_id, OSS_DIGIT, OSS_LETTER, '-', 'illegal:' . _('System ID')); ossim_valid($action, OSS_LETTER, '_', 'illegal:' . _('Action')); ossim_valid($log_id, OSS_LETTER, '_', 'illegal:' . _('Log id')); ossim_valid($num_rows, OSS_DIGIT, 'illegal:' . _('Num Rows')); if (ossim_error()) { $data['status'] = 'error'; $data['data'] = ossim_get_error(); echo json_encode($data); exit; } if ($action == 'view_log') { session_start(); if (!isset($_SESSION['log_files'])) { $_SESSION['log_files'] = Av_center::get_available_logs(); $log_files = $_SESSION['log_files']; } else { $log_files = $_SESSION['log_files']; } session_write_close(); if (empty($log_files[$log_id])) { $data['status'] = 'error'; $data['data'] = _("Log file not found"); } else { if (array_key_exists($log_files[$log_id]['section'], $profiles) || $log_files[$log_id]['section'] == 'system') { $data = Av_center::get_log_file($system_id, $log_id, $num_rows); } else { $data['status'] = 'error'; $data['data'] = _("You don't have permission to view this log"); }
require_once dirname(__FILE__) . '/../../../config.inc'; $system_id = POST('system_id'); ossim_valid($system_id, OSS_DIGIT, OSS_LETTER, '-', 'illegal:' . _('System ID')); //Profiles enabled $profiles = empty($_POST['profiles']) ? array() : array_flip(explode(',', $_POST['profiles'])); unset($profiles['database']); if (ossim_error()) { $config_nt = array('content' => ossim_get_error(), 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'margin: auto; width: 90%; text-align: center;'); $nt = new Notification('nt_1', $config_nt); $nt->show(); exit; } /************************************************************** ***************** Logs ***************** ***************************************************************/ $log_files = Av_center::get_available_logs(); $t_header = array('sensor' => array('id' => 'h_sensor', 'title' => _('Alienvault Sensor')), 'server' => array('id' => 'h_server', 'title' => _('Alienvault Server')), 'framework' => array('id' => 'h_framework', 'title' => _('AlienVault Web'))); ?> <div id='log_container'> <div class='sec_title'><?php echo _('System Logs'); ?> </div> <table id='t_logs'> <thead> <tr> <td class='subheader_e'></td> <td class='subheader sh_selected' id='h_system'><?php echo _('System');