Esempio n. 1
0
function get_open_tickets($conn)
{
    Incident::search($conn, array('status' => 'not_closed'), 'life_time', 'ASC', 1, 10);
    $tickets = Incident::search_count($conn);
    $return['error'] = FALSE;
    $return['output'] = intval($tickets);
    return $return;
}
Esempio n. 2
0
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "IncidentsIncidents");
$id = intval(GET('id'));
ossim_valid($id, OSS_NULLABLE, OSS_ALPHA, OSS_SCORE, 'illegal:' . _("id"));
if (ossim_error()) {
    echo ossim_error();
    exit;
}
if (!empty($id)) {
    $db = new ossim_db();
    $conn = $db->connect();
    $result = $conn->Execute("SELECT incident_id FROM incident_file WHERE id={$id}");
    $ticket_id = $result->fields["incident_id"];
    $incident_list = Incident::search($conn, array('incident_id' => $ticket_id));
    if (count($incident_list) != 1) {
        echo ossim_error(_("Invalid ticket ID or insufficient permissions"));
        exit;
    }
    if ($files = Incident_file::get_list($conn, "WHERE id = {$id}")) {
        $type = $files[0]->get_type();
        $fname = $files[0]->get_name();
        header("Content-type: {$type}");
        header('Content-Disposition: attachment; filename="' . $fname . '"');
        print $files[0]->get_content();
    }
    $db->close($conn);
} else {
    echo ossim_error(_("Invalid Incident ID"));
    exit;
Esempio n. 3
0
					</tr>
				</table>
			</td>
		</tr>
		<?php 
}
?>
	</table>
	
	<br/>
	<!-- end filter -->

	
		<?php 
$rows_per_page = 50;
$incident_list = Incident::search($conn, $criteria, $order_by, $order_mode, $page, $rows_per_page);
$total_incidents = Incident::search_count($conn);
if (count($incident_list) >= $total_incidents) {
    $total_incidents = count($incident_list);
    if ($total_incidents > 0) {
        $rows_per_page = $total_incidents;
    }
}
if ($total_incidents > 0) {
    $filter = '';
    foreach ($criteria as $key => $value) {
        $filter .= "&{$key}=" . urlencode($value);
    }
    if ($advanced_search) {
        $filter .= "&advanced_search=" . urlencode($advanced_search);
    }
Esempio n. 4
0
 }
 $incident_list = Incident::search($conn, array("status" => "Open"), $order_by, $order_mode, 1, 10);
 $unresolved_incidents = Incident::search_count($conn);
 //$incident_list = Incident::get_list($conn, "ORDER BY date DESC");
 $incident_list = Incident::search($conn, array(), "date", "DESC", 1, 1);
 $incident_date1 = $incident_list[0] ? $incident_list[0]->get_date() : 0;
 $incident_ticket_list = Incident_ticket::get_list($conn, "ORDER BY date DESC LIMIT 1");
 $incident_date2 = $incident_ticket_list[0] ? $incident_ticket_list[0]->get_date() : 0;
 if ($incident_list[0] || $incident_ticket_list[0]) {
     $incident_date = strtotime($incident_date1) > strtotime($incident_date2) ? $incident_date1 : $incident_date2;
     if ($incident_date == 0) {
         $incident_date = "__/__/__ --:--:--";
     }
 }
 //$incident_list = Incident::get_list($conn, "ORDER BY priority DESC");
 $incident_list = Incident::search($conn, array("status" => "Open"), "priority", "DESC", 1, 1);
 $incident_max_priority = $incident_list[0] ? $incident_list[0]->get_priority() : "-";
 $incident_max_priority_id = $incident_list[0] ? $incident_list[0]->get_id() : "0";
 // Get unresolved ALARMS
 $unresolved_alarms = Alarm::get_count($conn);
 list($alarm_date, $alarm_date_id) = Alarm::get_max_byfield($conn, "timestamp");
 list($alarm_max_risk, $alarm_max_risk_id) = Alarm::get_max_byfield($conn, "risk");
 if ($alarm_max_risk_id == "") {
     $alarm_max_risk = "-";
 }
 //
 list($siem, $events) = get_siem_events($conn, date("Y-m-d"));
 $i = 0;
 foreach ($siem as $p) {
     $plot .= "[" . $i++ . "," . $p["num_events"] . "],";
 }
Esempio n. 5
0
    exit;
}
while (!$rs->EOF) {
    $values = $rs->fields["Today"] . "," . $rs->fields["Yesterd"] . "," . $rs->fields["2DAgo"] . "," . $rs->fields["Week"] . "," . $rs->fields["2Weeks"];
    $rs->MoveNext();
}
// Tickets
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => "CURDATE()"), "", "", 1, 99999999);
$today = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), INTERVAL -1 DAY)", "CURDATE()")), "", "", 1, 999999999);
$yday = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_2Ago . ")", $_2Ago_interv)), "", "", 1, 999999999);
$ago2 = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_Week . ")", $_Week_interv)), "", "", 1, 999999999);
$week = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_2Week . ")", $_2Week_interv)), "", "", 1, 999999999);
$week2 = Incident::search_count($conn);
$values2 = $today . "," . $yday . "," . $ago2 . "," . $week . "," . $week2;
//
$db->close($conn);
$db->close($conn2);
//
$alarm_urls = "'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 86400) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 172800) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 604800) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 1209600) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
?>
  
	<script class="code" type="text/javascript">
	
$chart['axis_category'] = array('font' => "arial", 'bold' => true, 'size' => 11, 'color' => "000000", 'alpha' => 50, 'skip' => 0);
$chart['axis_ticks'] = array('value_ticks' => false, 'category_ticks' => true, 'major_thickness' => 2, 'minor_thickness' => 1, 'minor_count' => 3, 'major_color' => "000000", 'minor_color' => "888888", 'position' => "outside");
$chart['axis_value'] = array('font' => "arial", 'bold' => true, 'size' => 10, 'color' => "000000", 'alpha' => 50, 'steps' => 4, 'prefix' => "", 'suffix' => "", 'decimals' => 0, 'separator' => "", 'show_min' => true);
$chart['chart_transition'] = array('type' => "zoom", 'delay' => 0.5, 'duration' => 0.5, 'order' => "all");
$chart['chart_border'] = array('color' => "000000", 'top_thickness' => 1, 'bottom_thickness' => 2, 'left_thickness' => 0, 'right_thickness' => 0);
$chart['chart_grid_h'] = array('alpha' => 10, 'color' => "0066FF", 'thickness' => 28);
$chart['chart_grid_v'] = array('alpha' => 10, 'color' => "0066FF", 'thickness' => 1);
$chart['chart_rect'] = array('x' => 20, 'y' => 50, 'width' => 370, 'height' => 220, 'positive_color' => "FFFFFF", 'positive_alpha' => 40);
$chart['draw'] = array(array('type' => "text", 'color' => "000000", 'alpha' => 75, 'rotation' => 0, 'size' => 20, 'x' => 0, 'y' => 10, 'width' => 400, 'height' => 200, 'text' => "Ticket Resolution Time", 'h_align' => "left", 'v_align' => "top"));
$chart['legend_rect'] = array('x' => -100, 'y' => -100, 'width' => 10, 'height' => 10, 'margin' => 0);
$chart['series_color'] = array("dd6b66", "7e6cee");
$chart['series_gap'] = array('set_gap' => 0, 'bar_gap' => 0);
$ttl_groups = array();
//$list = Incident::search($conn, array('status' => 'Closed'));
// Filtered by USER
$list = Incident::search($conn, array('status' => 'Closed', 'in_charge' => $_SESSION['_user']));
$ttl_groups[1] = 0;
$ttl_groups[2] = 0;
$ttl_groups[3] = 0;
$ttl_groups[4] = 0;
$ttl_groups[5] = 0;
$ttl_groups[6] = 0;
$total_days = 0;
$day_count;
foreach ($list as $incident) {
    $ttl_secs = $incident->get_life_time('s');
    $days = round($ttl_secs / 60 / 60 / 24);
    $total_days += $days;
    $day_count++;
    if ($days < 1) {
        $days = 1;