$ip, 'resolve_text' => $res);
} else {
$response = array('resolve_ip' => $ip, 'resolve_text' => gettext("Cannot resolve"));
}
echo json_encode(str_replace("\\", "\\\\", $response)); // single escape chars can break JSON decode
exit;
}
/*
Build a list of allowed log files so we can reject others to prevent the page
from acting on unauthorized files.
*/
$allowed_logs = array(
"filter" => array("name" => "Firewall",
"shortcut" => "filter"),
);
// The logs to display are specified in a GET argument. Default to 'system' logs
if (!$_GET['logfile']) {
$logfile = 'filter';
$view = 'normal';
} else {
$logfile = $_GET['logfile'];
$view = $_GET['view'];
if (!array_key_exists($logfile, $allowed_logs)) {
/* Do not let someone attempt to load an unauthorized log. */
$logfile = 'filter';
$view = 'normal';
}
}
if ($view == 'normal') { $view_title = gettext("Normal View"); }
if ($view == 'dynamic') { $view_title = gettext("Dynamic View"); }
if ($view == 'summary') { $view_title = gettext("Summary View"); }
$rulenum = getGETPOSTsettingvalue('getrulenum', null);
if ($rulenum) {
list($rulenum, $tracker, $type) = explode(',', $rulenum);
$rule = find_rule_by_number($rulenum, $tracker, $type);
echo gettext("The rule that triggered this action is") . ":\n\n{$rule}";
exit;
}
// Log Filter Submit - Firewall
log_filter_form_firewall_submit();
// Manage Log Section - Code
manage_log_code();
// Status Logs Common - Code
status_logs_common_code();
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]), $view_title);
include("head.inc");
if (!$input_errors && $savemsg) {
print_info_box($savemsg);
$manage_log_active = false;
}
// Tab Array
tab_array_logs_common();
// Filter Section/Form - Firewall
filter_form_firewall();
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
$iflist = get_configured_interface_with_descr(false, true);
if ($iflist[$interfacefilter]) {
$interfacefilter = $iflist[$interfacefilter];
}
if ($filterlogentries_submit) {
$filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filterfieldsarray);
} else {
$filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filtertext, $interfacefilter);
}
?>
=gettext("Last ")?>=$nentries?> =gettext($allowed_logs[$logfile]["name"])?>=gettext(" log entries")?>
=gettext("Time")?> |
=gettext("Message")?> |
' .
gettext("TCP Flags") . ': F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR' . '
' .
' = Add to block list., = Pass traffic, = Resolve');
?>