'.__('Event successfully deleted').''; audit_db ($config['id_user'], $REMOTE_ADDR, "Event deleted","Deleted event: ".$descr); } else { echo '

'.__('Error deleting event').'

'; } } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to delete event ID".$id_evento); } } // Check Event (only incident write access). if (isset ($_GET["check"])) { $id_evento = get_parameter_get ("check"); // Look for event_id following parameters: id_group. $id_group = gime_idgroup_from_idevent ($id_evento); if (give_acl ($config["id_user"], $id_group, "IW") ==1){ $sql = "UPDATE tevento SET estado = 1, id_usuario = '".$config["id_user"]."' WHERE id_evento = ".$id_evento; $result = process_sql ($sql); if ($result !== false) { echo '

'.__('Event successfully validated').'

'; audit_db($config["id_user"],$REMOTE_ADDR, "Event validated","Validate event: ".return_event_description ($id_evento)); } else { echo '

'.__('Error validating event').'

'; } } else { audit_db ($config['id_user'],$REMOTE_ADDR, "ACL Violation", "Trying to checkout event ".return_event_description ($id_evento)); } } // Mass-process DELETE if (isset ($_POST["deletebt"])){ $count=0; while ($count <= $config["block_size"]) { if (isset ($_POST["eventid".$count])) { $event_id = get_parameter_post ("eventid".$count); $descr = return_event_description ($event_id); //Get description before it gets deleted // Look for event_id following parameters: id_group. $id_group = gime_idgroup_from_idevent ($event_id); if (give_acl ($config['id_user'], $id_group, "IM")) { process_sql ("DELETE FROM tevento WHERE id_evento = ".$event_id); audit_db ($config['id_user'], $REMOTE_ADDR, "Event deleted","Deleted event: ".$descr); } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation","Trying to delete event: ".$descr); } } $count++; } } // Mass-process UPDATE if (isset ($_POST["updatebt"])) { $count = 0; while ($count <= $config["block_size"]) { if (isset ($_POST["eventid".$count])) { $id_evento = get_parameter_post ("eventid".$count); $id_group = gime_idgroup_from_idevent($id_evento); if (give_acl ($config['id_user'], $id_group, "IW")) { $sql = "UPDATE tevento SET estado=1, id_usuario = '".$config['id_user']."' WHERE estado = 0 AND id_evento = ".$id_evento; $result = process_sql ($sql); audit_db ($config['id_user'], $REMOTE_ADDR, "Event validated","Validate event: ".return_event_description ($id_evento)); } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation","Trying to checkout event ID".$id_evento); } } $count++; } } // *********************************************************************** // Main code form / page // *********************************************************************** // Get data $offset = (int) get_parameter ( "offset",0); $ev_group = (int) get_parameter ("ev_group", 1); //1 = all $search = get_parameter ("search", ""); // free search $event_type = get_parameter ("event_type", ''); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", 0); // -1 all, 0 only red, 1 only green $id_agent = (int) get_parameter ("id_agent", -1); //-1 all, 0 system $id_event = (int) get_parameter ("id_event", -1); $pagination = (int) get_parameter ("pagination", $config["block_size"]); $config["block_size"] = $pagination; $groups = get_user_groups ($config["id_user"]); //Group selection if ($ev_group > 1 && in_array ($ev_group, array_keys ($groups))) { //If a group is selected and it's in the groups allowed $sql_post = " AND id_grupo = $ev_group"; } elseif (dame_admin ($config["id_user"])) { //Do nothing if you're admin, you get full access $sql_post = ""; $groups[0] = __('System Events'); } else { //Otherwise select all groups the user has rights to. $sql_post = " AND id_grupo IN (".implode (",", array_keys ($groups)).")"; } if ($status == 1) { $sql_post .= " AND estado = 1"; } elseif ($status == 0) { $sql_post .= " AND estado = 0"; } if ($search != "") $sql_post .= " AND evento LIKE '%$search%'"; if ($event_type != "") $sql_post .= " AND event_type = '$event_type'"; if ($severity != -1) $sql_post .= " AND criticity >= ".$severity; if ($id_agent != -1) $sql_post .= " AND id_agente = ".$id_agent; if ($id_event != -1) $sql_post .= " AND id_evento = ".$id_event; $url = "index.php?sec=eventos&sec2=operation/events/events&search=$search&event_type=$event_type&severity=$severity&status=$status&ev_group=$ev_group&refr=60&id_agent=$id_agent&id_event=$id_event"; echo "

".__('Events')." > ".__('Main event view'). " "; if ($config["pure"] == 1) { echo ""; } else { // Fullscreen echo ""; } echo "

"; echo ''; echo "".__('Event control filter')." ".''; if ($config["pure"] == 1) { echo "