Example #1
0
     echo "error###<div style='padding-left: 15px; text-align:left;'>" . _('We found the followings errors') . ':</div>';
     echo "<div style='padding-left: 15px; text-align:left;'>";
     echo "<div style='padding-left: 30px;'>" . implode('</div><div style="padding-left: 30px;">', $chk_parameters['error_msg']) . "</div>";
     echo "</div>";
     exit;
 }
 Session::logcheck('report-menu', 'ReportsReportServer');
 $TBackground = "#7B7B7B";
 $TForeground = "#FFFFFF";
 $SBackground = "#8CC221";
 $SForeground = "#FFFFFF";
 // Load css
 $styleCss = array('Title' => array('Background' => $TBackground, 'Foreground' => $TForeground), 'Subtitle' => array('Background' => $SBackground, 'Foreground' => $SForeground));
 // Make header - footer with replacements
 $footerContent = array('left' => 'User: '******' / [[date_y]]-[[date_m]]-[[date_d]] [[date_h]]:[[date_i]]:[[date_s]]', 'right' => 'Page [[page_cu]] / [[page_nb]]');
 $report_data = $section == 'forensics' ? get_freport_data($report_id) : get_report_data($report_id);
 // Init PDF Report
 $pdfReport = new Pdf_report($report_id, 'P', 'A4', NULL, FALSE);
 // Init html2pdf document
 //$header = ucwords(str_replace('_',' ',$pdfReport->getName()));
 $htmlPdfReport = new Pdf_html($report_id, $report_data['report_name'], Session::is_pro() ? 'default.png' : 'ossim.png', '', $styleCss, $footerContent);
 // Include php per each sub-report
 $runorder = 1;
 // Close session to stop() feature
 $dDB['_shared'] = new DBA_shared($report_id);
 $dDB['_shared']->truncate();
 session_write_close();
 foreach ($report_data['subreports'] as $r_key => $r_data) {
     //PDF Report with hidden modules
     if (!isset($_POST['sr_' . $r_data['id']]) && $report_id == $r_data["id"] && file_exists($r_data['report_file'])) {
         $subreport_id = $r_data['id'];
Example #2
0
function check_parameters($report_id, $parameters, $section)
{
    $res['error'] = FALSE;
    $res['error_msg'] = NULL;
    $d_reports = $section == 'forensics' ? get_freport_data($report_id) : get_report_data($report_id);
    if (empty($d_reports)) {
        $res['error'] = TRUE;
        $res['error_msg'][] = _('The report has been removed');
        return $res;
    }
    if (!empty($d_reports['parameters'])) {
        foreach ($d_reports['parameters'] as $data_p) {
            $type = $data_p['type'];
            $data = $type == 'asset' ? 'h_' . $parameters[$data_p['id']] : $parameters[$data_p['id']];
            $val = validate_parameter($type, $data);
            if ($val !== TRUE) {
                $res['error'] = TRUE;
                $res['error_msg'][] = $data_p['name'] . ': ' . $val;
            }
        }
    }
    return $res;
}
Example #3
0
Session::logcheck('analysis-menu', 'EventsForensics');
Session::logcheck('report-menu', 'ReportsReportServer');
require_once '../report/os_report_common.php';
$url = $_POST['url'] = GET('url');
$id = $_POST['id'] = GET('data');
$type = $_POST['type'] = GET('type');
$date_from = $_POST['date_from'] = GET('date_from');
$date_to = $_POST['date_to'] = GET('date_to');
$validate = array('url' => array('validation' => 'OSS_URL_ADDRESS', 'e_message' => 'illegal:' . _('Url')), 'id' => array('validation' => 'OSS_TEXT,OSS_PUNC_EXT', 'e_message' => 'illegal:' . _('Report')), 'type' => array('validation' => 'OSS_ALPHA', 'e_message' => 'illegal:' . _('Type')), 'date_from' => array('validation' => 'OSS_DATETIME', 'e_message' => 'illegal:' . _('Date From')), 'date_to' => array('validation' => 'OSS_DATETIME', 'e_message' => 'illegal:' . _('Date To')));
$validation_errors = validate_form_fields('GET', $validate);
$data['status'] = 'OK';
if (is_array($validation_errors) && !empty($validation_errors)) {
    $data['status'] = 'error';
    $data['data'] = $validation_errors;
} else {
    $d_reports = get_freport_data($id);
    if (empty($d_reports)) {
        $data['status'] = 'error';
        $validation_errors['id'] = _('Invalid Report ID');
    } else {
        if ($date_from == '') {
            $date_from = date('Y-m-d', strtotime('-10 year'));
        }
        if ($date_to == '') {
            $date_to = date('Y-m-d');
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>