' . print_image("images/normalscreen.png", true, array("title" => __('Normal screen'))) . ''; } else { // Fullscreen $link = '' . print_image("images/fullscreen.png", true, array("title" => __('Full screen'))) . ''; } // Header print_page_header (__("SNMP Console"), "images/computer_error.png", false, "", false, $link); // OPERATIONS // Delete SNMP Trap entry Event (only incident management access). if (isset ($_GET["delete"])){ $id_trap = (int) get_parameter_get ("delete", 0); if ($id_trap > 0 && give_acl ($config['id_user'], 0, "IM")) { $sql = sprintf ("DELETE FROM ttrap WHERE id_trap = %d", $id_trap); $result = process_sql ($sql); print_result_message ($result, __('Successfully deleted'), __('Could not be deleted')); } else { pandora_audit("ACL Violation", "Trying to delete SNMP event ID #".$id_trap); } } // Check Event (only incident write access). if (isset ($_GET["check"])) { $id_trap = (int) get_parameter_get ("check", 0); if ($id_trap > 1 && give_acl ($config['id_user'], 0, "IW")) { $sql = sprintf ("UPDATE ttrap SET status = 1, id_usuario = '%s' WHERE id_trap = %d", $config["id_user"], $id_trap); $result = process_sql ($sql); print_result_message ($result, __('Successfully updated'), __('Could not be updated')); } else { pandora_audit("ACL Violation", "Trying to checkout SNMP Trap ID".$id_trap); } } // Mass-process DELETE if (isset ($_POST["deletebt"])) { $trap_ids = get_parameter_post ("snmptrapid", array ()); if (is_array ($trap_ids) && give_acl ($config['id_user'], 0, "IW")) { foreach ($trap_ids as $id_trap) { $sql = sprintf ("DELETE FROM ttrap WHERE id_trap = %d", $id_trap); process_sql ($sql); } } else { pandora_audit("ACL Violation", "Trying to mass-delete SNMP Trap ID"); } } // Mass-process UPDATE if (isset ($_POST["updatebt"])) { $trap_ids = get_parameter_post ("snmptrapid", array ()); if (is_array ($trap_ids) && give_acl ($config['id_user'], 0, "IW")) { foreach ($trap_ids as $id_trap) { $sql = sprintf ("UPDATE ttrap SET status = 1, id_usuario = '%s' WHERE id_trap = %d", $config["id_user"], $id_trap); process_sql ($sql); } } else { pandora_audit("ACL Violation", "Trying to mass-delete SNMP Trap ID"); } } $sql = sprintf ("SELECT * FROM ttrap ORDER BY timestamp DESC LIMIT %d,%d",$offset,$pagination); $traps = get_db_all_rows_sql ($sql); // No traps if (empty ($traps)) { echo '