summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/status_logs_filter_dynamic.php
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2015-12-22 02:10:37 -0800
committerNOYB <Al_Stu@Frontier.com>2016-01-04 10:44:04 -0800
commit9e505d4b525a6511f607fbb4d506dcd8579a8d55 (patch)
tree1b2a548871fd8d604edc31f93d46734b0de5df99 /src/usr/local/www/status_logs_filter_dynamic.php
parent55f8344d7e64bc780fc0658f5d13801bec40f260 (diff)
downloadpfsense-9e505d4b525a6511f607fbb4d506dcd8579a8d55.zip
pfsense-9e505d4b525a6511f607fbb4d506dcd8579a8d55.tar.gz
Status - System Logs - Consolidate - Firewall Dynamic View
Add advanced filtering to firewall dynamic view. Add manage log to dynamic view. Update dynamic view view log selection method to same method as firewall and system logs.
Diffstat (limited to 'src/usr/local/www/status_logs_filter_dynamic.php')
-rwxr-xr-xsrc/usr/local/www/status_logs_filter_dynamic.php109
1 files changed, 76 insertions, 33 deletions
diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php
index 07b8fee..b0838ea 100755
--- a/src/usr/local/www/status_logs_filter_dynamic.php
+++ b/src/usr/local/www/status_logs_filter_dynamic.php
@@ -63,10 +63,7 @@
##|*MATCH=status_logs_filter_dynamic.php*
##|-PRIV
-require("guiconfig.inc");
-require_once("filter_log.inc");
-
-$filter_logfile = "{$g['varlog_path']}/filter.log";
+require_once("status_logs_common.inc");
/* Hardcode this. AJAX doesn't do so well with large numbers */
$nentries = 50;
@@ -74,16 +71,71 @@ $nentries = 50;
/* AJAX related routines */
handle_ajax($nentries, $nentries + 20);
-if ($_POST['clear']) {
- clear_log_file($filter_logfile);
+
+/*
+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';
+ }
}
-$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
+if ($view == 'normal') { $view_title = gettext("Normal View"); }
+if ($view == 'dynamic') { $view_title = gettext("Dynamic View"); }
+if ($view == 'summary') { $view_title = gettext("Summary View"); }
+
+
+// Log Filter Submit - Firewall
+log_filter_form_firewall_submit();
+
-$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall"), gettext("Dynamic View"));
-$shortcut_section = "firewall";
+// Manage Log Section - Code
+manage_log_code();
+
+
+// Miscellaneous Common - Code
+miscellaneous_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();
+
+
+// Log Filter Submit - Firewall
+filter_form_firewall();
+
+
+// Now the forms are complete we can draw the log table and its controls
+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);
+}
+#$filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100);
?>
<script type="text/javascript">
@@ -184,6 +236,7 @@ function fetch_new_rules() {
}
isBusy = true;
getURL('status_logs_filter_dynamic.php?lastsawtime=' + lastsawtime, fetch_new_rules_callback);
+// getURL('status_logs_filter_dynamic.php?lastsawtime=' + lastsawtime, fetch_new_rules_callback + '&amp;logfile=filter&amp;view=dynamic');
}
function fetch_new_rules_callback(callback_data) {
@@ -325,27 +378,6 @@ function toggleListDescriptions() {
//]]>
</script>
-<?php
-$tab_array = array();
-$tab_array[] = array(gettext("System"), false, "status_logs.php");
-$tab_array[] = array(gettext("Firewall"), true, "status_logs_filter.php");
-$tab_array[] = array(gettext("DHCP"), false, "status_logs.php?logfile=dhcpd");
-$tab_array[] = array(gettext("Portal Auth"), false, "status_logs.php?logfile=portalauth");
-$tab_array[] = array(gettext("IPsec"), false, "status_logs.php?logfile=ipsec");
-$tab_array[] = array(gettext("PPP"), false, "status_logs.php?logfile=ppp");
-$tab_array[] = array(gettext("VPN"), false, "status_logs_vpn.php");
-$tab_array[] = array(gettext("Load Balancer"), false, "status_logs.php?logfile=relayd");
-$tab_array[] = array(gettext("OpenVPN"), false, "status_logs.php?logfile=openvpn");
-$tab_array[] = array(gettext("NTP"), false, "status_logs.php?logfile=ntpd");
-$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php");
-display_top_tabs($tab_array);
-
-$tab_array = array();
-$tab_array[] = array(gettext("Normal View"), false, "/status_logs_filter.php");
-$tab_array[] = array(gettext("Dynamic View"), true, "/status_logs_filter_dynamic.php");
-$tab_array[] = array(gettext("Summary View"), false, "/status_logs_filter_summary.php");
-display_top_tabs($tab_array, false, 'nav nav-tabs');
-?>
<div class="panel panel-default">
<div class="panel-heading">
@@ -357,7 +389,7 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
<div class="table-responsive">
<table class="table table-striped table-hover table-condensed">
<thead>
- <tr>
+ <tr class="text-nowrap">
<th><?=gettext("Act")?></th>
<th><?=gettext("Time")?></th>
<th><?=gettext("IF")?></th>
@@ -394,7 +426,7 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
$dstPort = "";
}
?>
- <tr>
+ <tr class="text-nowrap">
<td>
<?php
if ($filterent['act'] == "block") {
@@ -425,14 +457,25 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
</div>
</div>
</div>
-<?php
+<?php
if ($tcpcnt > 0) {
+?>
+<div id="infoblock">
+<?php
print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' .
gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR');
+?>
+</div>
+<?php
}
?>
+<?php
+# Manage Log - Section/Form
+manage_log_section();
+?>
+
<script type="text/javascript">
//<![CDATA[
events.push(function() {
OpenPOWER on IntegriCloud