summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-26 22:50:36 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-26 22:50:36 +0545
commit4e3b667ceb8818babf58025e15e89f4703d9d606 (patch)
treed81fc8b8e9e14a9eb150910241b8303565b26077 /usr/local/www
parent8882e40f519424186f56663a43756b127d81c85b (diff)
downloadpfsense-4e3b667ceb8818babf58025e15e89f4703d9d606.zip
pfsense-4e3b667ceb8818babf58025e15e89f4703d9d606.tar.gz
Code style diag logs again
while making a fix today I noticed that I had done these early-on and had not tabbed out the HTML nicely...
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_logs.php7
-rw-r--r--usr/local/www/diag_logs_auth.php45
-rw-r--r--usr/local/www/diag_logs_dhcp.php47
-rw-r--r--usr/local/www/diag_logs_filter.php562
-rwxr-xr-xusr/local/www/diag_logs_filter_dynamic.php159
-rw-r--r--usr/local/www/diag_logs_filter_summary.php34
-rwxr-xr-xusr/local/www/diag_logs_gateways.php4
-rw-r--r--usr/local/www/diag_logs_ipsec.php6
-rw-r--r--usr/local/www/diag_logs_ntpd.php2
-rw-r--r--usr/local/www/diag_logs_openvpn.php4
-rw-r--r--usr/local/www/diag_logs_ppp.php4
-rw-r--r--usr/local/www/diag_logs_relayd.php4
-rwxr-xr-xusr/local/www/diag_logs_resolver.php4
-rw-r--r--usr/local/www/diag_logs_routing.php4
-rw-r--r--usr/local/www/diag_logs_settings.php426
-rwxr-xr-xusr/local/www/diag_logs_vpn.php73
-rw-r--r--usr/local/www/diag_logs_wireless.php4
17 files changed, 736 insertions, 653 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php
index 6520999..2cbfcbb 100755
--- a/usr/local/www/diag_logs.php
+++ b/usr/local/www/diag_logs.php
@@ -68,7 +68,7 @@ if ($filtertext) {
$filtertextmeta="?filtertext=$filtertext";
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("General"));
include("head.inc");
?>
@@ -95,7 +95,8 @@ include("head.inc");
?>
</td>
</tr>
- <tr><td class="tabnavtbl">
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("General"), true, "/diag_logs.php");
@@ -112,7 +113,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"),$nentries); ?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"), $nentries); ?></td>
</tr>
<?php
if ($filtertext) {
diff --git a/usr/local/www/diag_logs_auth.php b/usr/local/www/diag_logs_auth.php
index 230fadd..42bc0ba 100644
--- a/usr/local/www/diag_logs_auth.php
+++ b/usr/local/www/diag_logs_auth.php
@@ -56,7 +56,7 @@ if ($_POST['clear']) {
clear_log_file($portal_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Portal Auth"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Portal Auth"));
$shortcut_section = "captiveportal";
include("head.inc");
@@ -65,7 +65,8 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs captive portal">
- <tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -81,22 +82,30 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
- <tr>
- <td colspan="2" class="listtopic">
- <?php printf(gettext("Last %s Portal Auth log entries"),$nentries);?></td>
- </tr>
- <?php dump_clog($portal_logfile, $nentries, true); ?>
- <tr><td><br /><form action="diag_logs_auth.php" method="post">
- <input name="clear" type="submit" class="formbtn" value="<?= gettext("Clear log"); ?>"/></form></td></tr>
- </table>
- </div>
- </td>
- </tr>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
+ <tr>
+ <td colspan="2" class="listtopic">
+ <?php printf(gettext("Last %s Portal Auth log entries"), $nentries);?>
+ </td>
+ </tr>
+ <?php dump_clog($portal_logfile, $nentries, true); ?>
+ <tr>
+ <td>
+ <br />
+ <form action="diag_logs_auth.php" method="post">
+ <input name="clear" type="submit" class="formbtn" value="<?= gettext("Clear log"); ?>"/>
+ </form>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/diag_logs_dhcp.php b/usr/local/www/diag_logs_dhcp.php
index c60af86..f87845d 100644
--- a/usr/local/www/diag_logs_dhcp.php
+++ b/usr/local/www/diag_logs_dhcp.php
@@ -58,7 +58,7 @@ if ($_POST['clear']) {
services_dhcpd_configure();
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("DHCP"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("DHCP"));
$shortcut_section = "dhcp";
include("head.inc");
@@ -67,7 +67,8 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs dhcp">
- <tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -83,23 +84,31 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
- <tr>
- <td colspan="2" class="listtopic">
- <?php printf(gettext("Last %s DHCP service log entries"), $nentries);?></td>
- </tr>
- <?php dump_clog($dhcpd_logfile, $nentries); ?>
- <tr><td><br /><form action="diag_logs_dhcp.php" method="post">
- <input name="clear" type="submit" class="formbtn" value="<?= gettext("Clear log");?>" /></form></td>
- <td>NOTE: Clearing the log file will restart the DHCP daemon.</td></tr>
- </table>
- </div>
- </td>
- </tr>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
+ <tr>
+ <td colspan="2" class="listtopic">
+ <?php printf(gettext("Last %s DHCP service log entries"), $nentries);?>
+ </td>
+ </tr>
+ <?php dump_clog($dhcpd_logfile, $nentries); ?>
+ <tr>
+ <td>
+ <br />
+ <form action="diag_logs_dhcp.php" method="post">
+ <input name="clear" type="submit" class="formbtn" value="<?= gettext("Clear log");?>" />
+ </form>
+ </td>
+ <td>NOTE: Clearing the log file will restart the DHCP daemon.</td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index f81b0f5..df24cd4 100644
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -58,12 +58,11 @@ if (isset($_POST['resolve'])) {
$response = array('resolve_ip' => $ip, 'resolve_text' => gettext("Cannot resolve"));
}
- echo json_encode(str_replace("\\","\\\\", $response)); // single escape chars can break JSON decode
+ echo json_encode(str_replace("\\", "\\\\", $response)); // single escape chars can break JSON decode
exit;
}
-function getGETPOSTsettingvalue($settingname, $default)
-{
+function getGETPOSTsettingvalue($settingname, $default) {
$settingvalue = $default;
if ($_GET[$settingname]) {
$settingvalue = $_GET[$settingname];
@@ -126,7 +125,7 @@ if ($_POST['clear']) {
clear_log_file($filter_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Firewall"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall"));
$shortcut_section = "firewall";
include("head.inc");
@@ -135,7 +134,8 @@ include("head.inc");
<script src="/javascript/filter_log.js" type="text/javascript"></script>
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs filter">
- <tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -151,8 +151,10 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr><td class="tabnavtbl">
+ </td>
+ </tr>
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Normal View"), true, "/diag_logs_filter.php");
@@ -161,283 +163,297 @@ include("head.inc");
display_top_tabs($tab_array);
?>
</td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" style="sortableMultirow:<?=$config['syslog']['filterdescriptions'] === "2"?2:1?>" summary="main area">
- <tr>
- <td colspan="<?=(!isset($config['syslog']['rawfilter']))?7:2?>" align="left" valign="middle">
- <div id="filterlogentries_show" class="widgetconfigdiv" style="<?=(!isset($config['syslog']['rawfilter']))?"":"display:none"?>">
- <form id="filterlogentries" name="filterlogentries" action="diag_logs_filter.php" method="post">
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" style="sortableMultirow:<?=$config['syslog']['filterdescriptions'] === "2"?2:1?>" summary="main area">
+ <tr>
+ <td colspan="<?=(!isset($config['syslog']['rawfilter']))?7:2?>" align="left" valign="middle">
+ <div id="filterlogentries_show" class="widgetconfigdiv" style="<?=(!isset($config['syslog']['rawfilter']))?"":"display:none"?>">
+ <form id="filterlogentries" name="filterlogentries" action="diag_logs_filter.php" method="post">
<?php
$Include_Act = explode(",", str_replace(" ", ",", $filterfieldsarray['act']));
if ($filterfieldsarray['interface'] == "All") $interface = "";
?>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="action">
- <tr>
- <td rowspan="2">
- <div align="center"><?=gettext("Action");?></div>
- <div align="left">
- <input id="actpass" name="actpass" type="checkbox" value="Pass" <?php if (in_arrayi('Pass', $Include_Act)) echo "checked=\"checked\""; ?> /> Pass<br />
- <input id="actblock" name="actblock" type="checkbox" value="Block" <?php if (in_arrayi('Block', $Include_Act)) echo "checked=\"checked\""; ?> /> Block<br />
- </div>
- </td>
- <td>
- <div align="center"><?=gettext("Time");?></div>
- <div align="center"><input id="filterlogentries_time" name="filterlogentries_time" class="formfld search" type="text" size="12" value="<?= htmlspecialchars($filterfieldsarray['time']) ?>" /></div>
- </td>
- <td>
- <div align="center"><?=gettext("Source IP Address");?></div>
- <div align="center"><input id="filterlogentries_sourceipaddress" name="filterlogentries_sourceipaddress" class="formfld search" type="text" size="35" value="<?= htmlspecialchars($filterfieldsarray['srcip']) ?>" /></div>
- </td>
- <td>
- <div align="center"><?=gettext("Source Port");?></div>
- <div align="center"><input id="filterlogentries_sourceport" name="filterlogentries_sourceport" class="formfld search" type="text" size="10" value="<?= htmlspecialchars($filterfieldsarray['srcport']) ?>" /></div>
- </td>
- <td>
- <div align="center"><?=gettext("Protocol");?></div>
- <div align="center"><input id="filterlogentries_protocol" name="filterlogentries_protocol" class="formfld search" type="text" size="5" value="<?= htmlspecialchars($filterfieldsarray['proto']) ?>" /></div>
- </td>
- <td>
- <div align="center" style="vertical-align:top;"><?=gettext("Quantity");?></div>
- <div align="center" style="vertical-align:top;"><input id="filterlogentries_qty" name="filterlogentries_qty" class="" type="text" size="6" value="<?= htmlspecialchars($filterlogentries_qty) ?>" /></div>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <div align="center"><?=gettext("Interface");?></div>
- <div align="center"><input id="filterlogentries_interfaces" name="filterlogentries_interfaces" class="formfld search" type="text" size="12" value="<?= htmlspecialchars($filterfieldsarray['interface']) ?>" /></div>
- </td>
- <td valign="top">
- <div align="center"><?=gettext("Destination IP Address");?></div>
- <div align="center"><input id="filterlogentries_destinationipaddress" name="filterlogentries_destinationipaddress" class="formfld search" type="text" size="35" value="<?= htmlspecialchars($filterfieldsarray['dstip']) ?>" /></div>
- </td>
- <td valign="top">
- <div align="center"><?=gettext("Destination Port");?></div>
- <div align="center"><input id="filterlogentries_destinationport" name="filterlogentries_destinationport" class="formfld search" type="text" size="10" value="<?= htmlspecialchars($filterfieldsarray['dstport']) ?>" /></div>
- </td>
- <td valign="top">
- <div align="center"><?=gettext("Protocol Flags");?></div>
- <div align="center"><input id="filterlogentries_protocolflags" name="filterlogentries_protocolflags" class="formfld search" type="text" size="5" value="<?= htmlspecialchars($filterfieldsarray['tcpflags']) ?>" /></div>
- </td>
- <td valign="bottom">
- <div align="center"><input id="filterlogentries_submit" name="filterlogentries_submit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" /></div>
- </td>
- </tr>
- <tr>
- <td></td>
- <td colspan="5">
- <?printf(gettext('Matches %1$s regular expression%2$s.'), '<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">', '</a>');?>&nbsp;&nbsp;
- <?=gettext("Precede with exclamation (!) as first character to exclude match.");?>&nbsp;&nbsp;
- </td>
- </tr>
- </table>
- </form>
- </div>
- <div id="filterform_show" class="widgetconfigdiv" style="<?=(!isset($config['syslog']['rawfilter']))?"display:none":""?>">
- <form id="filterform" name="filterform" action="diag_logs_filter.php" method="post">
- <table width="0%" border="0" cellpadding="0" cellspacing="0" summary="firewall log">
- <tr>
- <td>
- <div align="center" style="vertical-align:top;"><?=gettext("Interface");?></div>
- <div align="center" style="vertical-align:top;">
- <select name="interface" onchange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
- <option value="" <?=$interfacefilter?"":"selected=\"selected\""?>>*Any interface</option>
- <?php
- $iflist = get_configured_interface_with_descr(false, true);
- //$iflist = get_interface_list();
- // Allow extending of the firewall edit interfaces
- pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
- foreach ($iflist as $if => $ifdesc) {
- $interfaces[$if] = $ifdesc;
- }
-
- if ($config['l2tp']['mode'] == "server") {
- $interfaces['l2tp'] = "L2TP VPN";
- }
-
- if ($config['pptpd']['mode'] == "server") {
- $interfaces['pptp'] = "PPTP VPN";
- }
-
- if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
- $interfaces['pppoe'] = "PPPoE Server";
- }
-
- /* add ipsec interfaces */
- if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) {
- $interfaces["enc0"] = "IPsec";
- }
-
- /* add openvpn/tun interfaces */
- if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
- $interfaces["openvpn"] = "OpenVPN";
- }
-
- foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?=($iface==$interfacefilter)?"selected=\"selected\"":"";?>><?=htmlspecialchars($ifacename);?></option>
- <?php endforeach; ?>
- </select>
- </div>
- </td>
- <td>
- <div align="center" style="vertical-align:top;"><?=gettext("Filter expression");?></div>
- <div align="center" style="vertical-align:top;"><input id="filtertext" name="filtertext" class="formfld search" style="vertical-align:top;" type="text" size="35" value="<?= htmlspecialchars($filtertext) ?>" /></div>
- </td>
- <td>
- <div align="center" style="vertical-align:top;"><?=gettext("Quantity");?></div>
- <div align="center" style="vertical-align:top;"><input id="filterlogentries_qty" name="filterlogentries_qty" class="" style="vertical-align:top;" type="text" size="6" value="<?= htmlspecialchars($filterlogentries_qty) ?>" /></div>
- </td>
- <td>
- <div align="center" style="vertical-align:top;">&nbsp;</div>
- <div align="center" style="vertical-align:top;"><input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" style="vertical-align:top;" value="<?=gettext("Filter");?>" /></div>
- </td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2">
- <?printf(gettext('Matches %1$s regular expression%2$s.'), '<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">', '</a>');?>&nbsp;&nbsp;
- </td>
- </tr>
- </table>
- </form>
- </div>
- <div style="float: right; vertical-align:middle">
- <br />
- <?php if (!isset($config['syslog']['rawfilter']) && (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2")):?>
- <a href="#" onclick="toggleListDescriptions()">Show/hide rule descriptions</a>
- <?php endif;?>
- </div>
- </td>
- </tr>
-<?php if (!isset($config['syslog']['rawfilter'])):
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="action">
+ <tr>
+ <td rowspan="2">
+ <div align="center"><?=gettext("Action");?></div>
+ <div align="left">
+ <input id="actpass" name="actpass" type="checkbox" value="Pass" <?php if (in_arrayi('Pass', $Include_Act)) echo "checked=\"checked\""; ?> /> Pass<br />
+ <input id="actblock" name="actblock" type="checkbox" value="Block" <?php if (in_arrayi('Block', $Include_Act)) echo "checked=\"checked\""; ?> /> Block<br />
+ </div>
+ </td>
+ <td>
+ <div align="center"><?=gettext("Time");?></div>
+ <div align="center"><input id="filterlogentries_time" name="filterlogentries_time" class="formfld search" type="text" size="12" value="<?= htmlspecialchars($filterfieldsarray['time']) ?>" /></div>
+ </td>
+ <td>
+ <div align="center"><?=gettext("Source IP Address");?></div>
+ <div align="center"><input id="filterlogentries_sourceipaddress" name="filterlogentries_sourceipaddress" class="formfld search" type="text" size="35" value="<?= htmlspecialchars($filterfieldsarray['srcip']) ?>" /></div>
+ </td>
+ <td>
+ <div align="center"><?=gettext("Source Port");?></div>
+ <div align="center"><input id="filterlogentries_sourceport" name="filterlogentries_sourceport" class="formfld search" type="text" size="10" value="<?= htmlspecialchars($filterfieldsarray['srcport']) ?>" /></div>
+ </td>
+ <td>
+ <div align="center"><?=gettext("Protocol");?></div>
+ <div align="center"><input id="filterlogentries_protocol" name="filterlogentries_protocol" class="formfld search" type="text" size="5" value="<?= htmlspecialchars($filterfieldsarray['proto']) ?>" /></div>
+ </td>
+ <td>
+ <div align="center" style="vertical-align:top;"><?=gettext("Quantity");?></div>
+ <div align="center" style="vertical-align:top;"><input id="filterlogentries_qty" name="filterlogentries_qty" class="" type="text" size="6" value="<?= htmlspecialchars($filterlogentries_qty) ?>" /></div>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <div align="center"><?=gettext("Interface");?></div>
+ <div align="center"><input id="filterlogentries_interfaces" name="filterlogentries_interfaces" class="formfld search" type="text" size="12" value="<?= htmlspecialchars($filterfieldsarray['interface']) ?>" /></div>
+ </td>
+ <td valign="top">
+ <div align="center"><?=gettext("Destination IP Address");?></div>
+ <div align="center"><input id="filterlogentries_destinationipaddress" name="filterlogentries_destinationipaddress" class="formfld search" type="text" size="35" value="<?= htmlspecialchars($filterfieldsarray['dstip']) ?>" /></div>
+ </td>
+ <td valign="top">
+ <div align="center"><?=gettext("Destination Port");?></div>
+ <div align="center"><input id="filterlogentries_destinationport" name="filterlogentries_destinationport" class="formfld search" type="text" size="10" value="<?= htmlspecialchars($filterfieldsarray['dstport']) ?>" /></div>
+ </td>
+ <td valign="top">
+ <div align="center"><?=gettext("Protocol Flags");?></div>
+ <div align="center"><input id="filterlogentries_protocolflags" name="filterlogentries_protocolflags" class="formfld search" type="text" size="5" value="<?= htmlspecialchars($filterfieldsarray['tcpflags']) ?>" /></div>
+ </td>
+ <td valign="bottom">
+ <div align="center"><input id="filterlogentries_submit" name="filterlogentries_submit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" /></div>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td colspan="5">
+ <?printf(gettext('Matches %1$s regular expression%2$s.'), '<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">', '</a>');?>&nbsp;&nbsp;
+ <?=gettext("Precede with exclamation (!) as first character to exclude match.");?>&nbsp;&nbsp;
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ <div id="filterform_show" class="widgetconfigdiv" style="<?=(!isset($config['syslog']['rawfilter']))?"display:none":""?>">
+ <form id="filterform" name="filterform" action="diag_logs_filter.php" method="post">
+ <table width="0%" border="0" cellpadding="0" cellspacing="0" summary="firewall log">
+ <tr>
+ <td>
+ <div align="center" style="vertical-align:top;"><?=gettext("Interface");?></div>
+ <div align="center" style="vertical-align:top;">
+ <select name="interface" onchange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
+ <option value="" <?=$interfacefilter?"":"selected=\"selected\""?>>*Any interface</option>
+<?php
$iflist = get_configured_interface_with_descr(false, true);
- if ($iflist[$interfacefilter]) {
- $interfacefilter = $iflist[$interfacefilter];
+ //$iflist = get_interface_list();
+ // Allow extending of the firewall edit interfaces
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
+ foreach ($iflist as $if => $ifdesc) {
+ $interfaces[$if] = $ifdesc;
}
- if ($filterlogentries_submit) {
- $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
- } else {
- $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
+
+ if ($config['l2tp']['mode'] == "server") {
+ $interfaces['l2tp'] = "L2TP VPN";
+ }
+
+ if ($config['pptpd']['mode'] == "server") {
+ $interfaces['pptp'] = "PPTP VPN";
+ }
+
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
+ $interfaces['pppoe'] = "PPPoE Server";
+ }
+
+ /* add ipsec interfaces */
+ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) {
+ $interfaces["enc0"] = "IPsec";
+ }
+
+ /* add openvpn/tun interfaces */
+ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
+ $interfaces["openvpn"] = "OpenVPN";
}
+
+ foreach ($interfaces as $iface => $ifacename):
+?>
+ <option value="<?=$iface;?>" <?=($iface == $interfacefilter)?"selected=\"selected\"":"";?>><?=htmlspecialchars($ifacename);?></option>
+<?php
+ endforeach;
+?>
+ </select>
+ </div>
+ </td>
+ <td>
+ <div align="center" style="vertical-align:top;"><?=gettext("Filter expression");?></div>
+ <div align="center" style="vertical-align:top;"><input id="filtertext" name="filtertext" class="formfld search" style="vertical-align:top;" type="text" size="35" value="<?= htmlspecialchars($filtertext) ?>" /></div>
+ </td>
+ <td>
+ <div align="center" style="vertical-align:top;"><?=gettext("Quantity");?></div>
+ <div align="center" style="vertical-align:top;"><input id="filterlogentries_qty" name="filterlogentries_qty" class="" style="vertical-align:top;" type="text" size="6" value="<?= htmlspecialchars($filterlogentries_qty) ?>" /></div>
+ </td>
+ <td>
+ <div align="center" style="vertical-align:top;">&nbsp;</div>
+ <div align="center" style="vertical-align:top;"><input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" style="vertical-align:top;" value="<?=gettext("Filter");?>" /></div>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td colspan="2">
+ <?printf(gettext('Matches %1$s regular expression%2$s.'), '<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">', '</a>');?>&nbsp;&nbsp;
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ <div style="float: right; vertical-align:middle">
+ <br />
+ <?php if (!isset($config['syslog']['rawfilter']) && (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2")):?>
+ <a href="#" onclick="toggleListDescriptions()">Show/hide rule descriptions</a>
+ <?php endif;?>
+ </div>
+ </td>
+ </tr>
+<?php
+ if (!isset($config['syslog']['rawfilter'])):
+ $iflist = get_configured_interface_with_descr(false, true);
+ if ($iflist[$interfacefilter]) {
+ $interfacefilter = $iflist[$interfacefilter];
+ }
+ if ($filterlogentries_submit) {
+ $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
+ } else {
+ $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
+ }
+?>
+ <tr>
+ <td colspan="<?=$config['syslog']['filterdescriptions'] === "1"?7:6?>" class="listtopic">
+<?php
+ if ((!$filtertext) && (!$filterfieldsarray)) {
+ printf(gettext("Last %s firewall log entries."), count($filterlog));
+ } else {
+ echo count($filterlog). ' ' . gettext("matched log entries.") . ' ';
+ }
+ printf(gettext("Max(%s)"), $nentries);
?>
- <tr>
- <td colspan="<?=$config['syslog']['filterdescriptions']==="1"?7:6?>" class="listtopic">
- <?php
- if ((!$filtertext) && (!$filterfieldsarray)) {
- printf(gettext("Last %s firewall log entries."),count($filterlog));
- } else {
- echo count($filterlog). ' ' . gettext("matched log entries.") . ' ';
- }
- printf(gettext("Max(%s)"),$nentries);
- ?>
- </td>
- </tr>
- <tr class="sortableHeaderRowIdentifier">
- <td width="10%" class="listhdrr"><?=gettext("Act");?></td>
- <td width="10%" class="listhdrr"><?=gettext("Time");?></td>
- <td width="15%" class="listhdrr"><?=gettext("If");?></td>
- <?php if ($config['syslog']['filterdescriptions'] === "1"):?>
- <td width="10%" class="listhdrr"><?=gettext("Rule");?></td>
- <?php endif;?>
- <td width="25%" class="listhdrr"><?=gettext("Source");?></td>
- <td width="25%" class="listhdrr"><?=gettext("Destination");?></td>
- <td width="15%" class="listhdrr"><?=gettext("Proto");?></td>
- </tr>
- <?php
- if ($config['syslog']['filterdescriptions']) {
- buffer_rules_load();
+ </td>
+ </tr>
+ <tr class="sortableHeaderRowIdentifier">
+ <td width="10%" class="listhdrr"><?=gettext("Act");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Time");?></td>
+ <td width="15%" class="listhdrr"><?=gettext("If");?></td>
+ <?php if ($config['syslog']['filterdescriptions'] === "1"):?>
+ <td width="10%" class="listhdrr"><?=gettext("Rule");?></td>
+ <?php endif;?>
+ <td width="25%" class="listhdrr"><?=gettext("Source");?></td>
+ <td width="25%" class="listhdrr"><?=gettext("Destination");?></td>
+ <td width="15%" class="listhdrr"><?=gettext("Proto");?></td>
+ </tr>
+<?php
+ if ($config['syslog']['filterdescriptions']) {
+ buffer_rules_load();
+ }
+ $rowIndex = 0;
+ foreach ($filterlog as $filterent):
+ $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
+ $rowIndex++;
+?>
+ <tr class="<?=$evenRowClass?>">
+ <td class="listMRlr nowrap" align="center" sorttable_customkey="<?=$filterent['act']?>">
+ <center>
+ <a onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);">
+ <img border="0" src="<?php echo find_action_image($filterent['act']);?>" width="11" height="11" align="middle" alt="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" />
+ <?php if ($filterent['count']) echo $filterent['count'];?>
+ </a>
+ </center>
+ </td>
+ <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
+ <td class="listMRr nowrap">
+ <?php if ($filterent['direction'] == "out"): ?>
+ <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/out.gif" alt="Direction=OUT" title="Direction=OUT"/>
+ <?php endif; ?>
+ <?php echo htmlspecialchars($filterent['interface']);?>
+ </td>
+<?php
+ if ($config['syslog']['filterdescriptions'] === "1") {
+ echo("<td class=\"listMRr nowrap\">" . find_rule_by_number_buffer($filterent['rulenum'], $filterent['tracker'], $filterent['act']) . "</td>");
}
- $rowIndex = 0;
- foreach ($filterlog as $filterent):
- $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
- $rowIndex++;?>
- <tr class="<?=$evenRowClass?>">
- <td class="listMRlr nowrap" align="center" sorttable_customkey="<?=$filterent['act']?>">
- <center>
- <a onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);">
- <img border="0" src="<?php echo find_action_image($filterent['act']);?>" width="11" height="11" align="middle" alt="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" />
- <?php if ($filterent['count']) echo $filterent['count'];?></a></center></td>
- <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
- <td class="listMRr nowrap">
- <?php if ($filterent['direction'] == "out"): ?>
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/out.gif" alt="Direction=OUT" title="Direction=OUT"/>
- <?php endif; ?>
- <?php echo htmlspecialchars($filterent['interface']);?></td>
- <?php
- if ($config['syslog']['filterdescriptions'] === "1") {
- echo("<td class=\"listMRr nowrap\">".find_rule_by_number_buffer($filterent['rulenum'],$filterent['tracker'],$filterent['act'])."</td>");
- }
-
- $int = strtolower($filterent['interface']);
- $proto = strtolower($filterent['proto']);
- if ($filterent['version'] == '6') {
- $ipproto = "inet6";
- $filterent['srcip'] = "[{$filterent['srcip']}]";
- $filterent['dstip'] = "[{$filterent['dstip']}]";
- } else {
- $ipproto = "inet";
- }
-
- $srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto);
- $src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']);
- $dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto);
- $dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']);
- ?>
- <td class="listMRr nowrap">
- <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $src_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
- <a href="easyrule.php?<?php echo "action=block&amp;int={$int}&amp;src={$filterent['srcip']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List");?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")?>')">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_block_add.gif" alt="Icon Easy Rule: Add to Block List" /></a>
- <?php echo $srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>';?>
- </td>
- <td class="listMRr nowrap">
- <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $dst_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
- <a href="easyrule.php?<?php echo "action=pass&amp;int={$int}&amp;proto={$proto}&amp;src={$filterent['srcip']}&amp;dst={$filterent['dstip']}&amp;dstport={$filterent['dstport']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic");?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")?>')">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_pass_add.gif" alt="Icon Easy Rule: Pass this traffic" /></a>
- <?php echo $dststr . '<span class="RESOLVE-' . $dst_htmlclass . '"></span>';?>
- </td>
- <?php
- if ($filterent['proto'] == "TCP") {
- $filterent['proto'] .= ":{$filterent['tcpflags']}";
- }
- ?>
- <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
- </tr>
- <?php if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2"):?>
- <tr class="<?=$evenRowClass?>">
- <td colspan="2" class="listMRDescriptionL listMRlr" />
- <td colspan="4" class="listMRDescriptionR listMRr nowrap"><?=find_rule_by_number_buffer($filterent['rulenum'],$filterent['tracker'],$filterent['act']);?></td>
- </tr>
- <?php
- endif;
- endforeach;
- buffer_rules_clear();
- ?>
-<?php else: ?>
- <tr>
- <td colspan="2" class="listtopic">
- <?php printf(gettext("Last %s firewall log entries"),$nentries);?></td>
- </tr>
- <?php
- if ($filtertext) {
- dump_clog($filter_logfile, $nentries, true, array("$filtertext"));
+
+ $int = strtolower($filterent['interface']);
+ $proto = strtolower($filterent['proto']);
+ if ($filterent['version'] == '6') {
+ $ipproto = "inet6";
+ $filterent['srcip'] = "[{$filterent['srcip']}]";
+ $filterent['dstip'] = "[{$filterent['dstip']}]";
} else {
- dump_clog($filter_logfile, $nentries);
+ $ipproto = "inet";
+ }
+
+ $srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto);
+ $src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']);
+ $dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto);
+ $dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']);
+?>
+ <td class="listMRr nowrap">
+ <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $src_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
+ <a href="easyrule.php?<?php echo "action=block&amp;int={$int}&amp;src={$filterent['srcip']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List");?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")?>')">
+ <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_block_add.gif" alt="Icon Easy Rule: Add to Block List" />
+ </a>
+ <?php echo $srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>';?>
+ </td>
+ <td class="listMRr nowrap">
+ <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $dst_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
+ <a href="easyrule.php?<?php echo "action=pass&amp;int={$int}&amp;proto={$proto}&amp;src={$filterent['srcip']}&amp;dst={$filterent['dstip']}&amp;dstport={$filterent['dstport']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic");?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")?>')">
+ <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_pass_add.gif" alt="Icon Easy Rule: Pass this traffic" />
+ </a>
+ <?php echo $dststr . '<span class="RESOLVE-' . $dst_htmlclass . '"></span>';?>
+ </td>
+<?php
+ if ($filterent['proto'] == "TCP") {
+ $filterent['proto'] .= ":{$filterent['tcpflags']}";
}
- ?>
-<?php endif; ?>
- <tr>
- <td align="left" valign="top" colspan="3">
- <form id="clearform" name="clearform" action="diag_logs_filter.php" method="post" style="margin-top: 14px;">
- <input id="submit" name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log");?>" />
- </form>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
+?>
+ <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
+ </tr>
+<?php
+ if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2"):
+?>
+ <tr class="<?=$evenRowClass?>">
+ <td colspan="2" class="listMRDescriptionL listMRlr" />
+ <td colspan="4" class="listMRDescriptionR listMRr nowrap"><?=find_rule_by_number_buffer($filterent['rulenum'], $filterent['tracker'], $filterent['act']);?></td>
+ </tr>
+<?php
+ endif;
+ endforeach;
+ buffer_rules_clear();
+ else:
+?>
+ <tr>
+ <td colspan="2" class="listtopic">
+ <?php printf(gettext("Last %s firewall log entries"), $nentries);?>
+ </td>
+ </tr>
+<?php
+ if ($filtertext) {
+ dump_clog($filter_logfile, $nentries, true, array("$filtertext"));
+ } else {
+ dump_clog($filter_logfile, $nentries);
+ }
+ endif;
+?>
+ <tr>
+ <td align="left" valign="top" colspan="3">
+ <form id="clearform" name="clearform" action="diag_logs_filter.php" method="post" style="margin-top: 14px;">
+ <input id="submit" name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log");?>" />
+ </form>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<p><span class="vexpl"><a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">TCP Flags</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, W - CWR</span></p>
diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php
index f9d42f5..16ced9f 100755
--- a/usr/local/www/diag_logs_filter_dynamic.php
+++ b/usr/local/www/diag_logs_filter_dynamic.php
@@ -60,7 +60,7 @@ if ($_POST['clear']) {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Firewall (Dynamic View)"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall (Dynamic View)"));
$shortcut_section = "firewall";
include("head.inc");
@@ -85,7 +85,7 @@ include("head.inc");
?>
/* Called by the AJAX updater */
function format_log_line(row) {
- if ( row[8] == '6' ) {
+ if (row[8] == '6') {
srcIP = '[' + row[3] + ']';
dstIP = '[' + row[5] + ']';
} else {
@@ -93,12 +93,12 @@ include("head.inc");
dstIP = row[5];
}
- if ( row[4] == '' ) {
+ if (row[4] == '') {
srcPort = '';
} else {
srcPort = ':' + row[4];
}
- if ( row[6] == '' ) {
+ if (row[6] == '') {
dstPort = '';
} else {
dstPort = ':' + row[6];
@@ -116,7 +116,8 @@ include("head.inc");
</script>
<script src="/javascript/filter_log.js" type="text/javascript"></script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs filter dynamic">
- <tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -132,8 +133,10 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr><td class="tabnavtbl">
+ </td>
+ </tr>
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Normal View"), false, "/diag_logs_filter.php");
@@ -141,76 +144,78 @@ include("head.inc");
$tab_array[] = array(gettext("Summary View"), false, "/diag_logs_filter_summary.php");
display_top_tabs($tab_array);
?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
- <thead>
- <tr>
- <td colspan="6" class="listtopic">
- <?php printf(gettext("Last %s records"),$nentries);?>; <?=gettext("Pause:");?><input style="vertical-align:middle;" type="checkbox" onclick="javascript:toggle_pause();" />
- </td>
- </tr>
- <tr>
- <td width="10%" class="listhdrr"><?=gettext("Act");?></td>
- <td width="10%" class="listhdrr"><?=gettext("Time");?></td>
- <td width="15%" class="listhdrr"><?=gettext("If");?></td>
- <td width="25%" class="listhdrr"><?=gettext("Source");?></td>
- <td width="25%" class="listhdrr"><?=gettext("Destination");?></td>
- <td width="15%" class="listhdrr"><?=gettext("Proto");?></td>
- </tr>
- </thead>
- <tbody id="filter-log-entries">
- <?php
- $rowIndex = 0;
- foreach ($filterlog as $filterent):
- $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
- $rowIndex++;
- if ($filterent['version'] == '6') {
- $srcIP = "[" . htmlspecialchars($filterent['srcip']) . "]";
- $dstIP = "[" . htmlspecialchars($filterent['dstip']) . "]";
- } else {
- $srcIP = htmlspecialchars($filterent['srcip']);
- $dstIP = htmlspecialchars($filterent['dstip']);
- }
-
- if ($filterent['srcport']) {
- $srcPort = ":" . htmlspecialchars($filterent['srcport']);
- } else {
- $srcPort = "";
- }
-
- if ($filterent['dstport']) {
- $dstPort = ":" . htmlspecialchars($filterent['dstport']);
- } else {
- $dstPort = "";
- }
- ?>
- <tr class="<?=$evenRowClass?>">
- <td class="listMRlr nowrap" align="center">
- <a href="#" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);">
- <img border="0" src="<?php echo find_action_image($filterent['act']);?>" width="11" height="11" alt="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" />
- </a>
- </td>
- <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
- <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['interface']);?></td>
- <td class="listMRr nowrap"><?php echo $srcIP . $srcPort;?></td>
- <td class="listMRr nowrap"><?php echo $dstIP . $dstPort;?></td>
- <?php
- if ($filterent['proto'] == "TCP") {
- $filterent['proto'] .= ":{$filterent['tcpflags']}";
- }
- ?>
- <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
- </td>
- </tr>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+ <thead>
+ <tr>
+ <td colspan="6" class="listtopic">
+ <?php printf(gettext("Last %s records"), $nentries);?>; <?=gettext("Pause:");?><input style="vertical-align:middle;" type="checkbox" onclick="javascript:toggle_pause();" />
+ </td>
+ </tr>
+ <tr>
+ <td width="10%" class="listhdrr"><?=gettext("Act");?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Time");?></td>
+ <td width="15%" class="listhdrr"><?=gettext("If");?></td>
+ <td width="25%" class="listhdrr"><?=gettext("Source");?></td>
+ <td width="25%" class="listhdrr"><?=gettext("Destination");?></td>
+ <td width="15%" class="listhdrr"><?=gettext("Proto");?></td>
+ </tr>
+ </thead>
+ <tbody id="filter-log-entries">
+<?php
+ $rowIndex = 0;
+ foreach ($filterlog as $filterent):
+ $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
+ $rowIndex++;
+ if ($filterent['version'] == '6') {
+ $srcIP = "[" . htmlspecialchars($filterent['srcip']) . "]";
+ $dstIP = "[" . htmlspecialchars($filterent['dstip']) . "]";
+ } else {
+ $srcIP = htmlspecialchars($filterent['srcip']);
+ $dstIP = htmlspecialchars($filterent['dstip']);
+ }
+
+ if ($filterent['srcport']) {
+ $srcPort = ":" . htmlspecialchars($filterent['srcport']);
+ } else {
+ $srcPort = "";
+ }
+
+ if ($filterent['dstport']) {
+ $dstPort = ":" . htmlspecialchars($filterent['dstport']);
+ } else {
+ $dstPort = "";
+ }
+?>
+ <tr class="<?=$evenRowClass?>">
+ <td class="listMRlr nowrap" align="center">
+ <a href="#" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);">
+ <img border="0" src="<?php echo find_action_image($filterent['act']);?>" width="11" height="11" alt="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" />
+ </a>
+ </td>
+ <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
+ <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['interface']);?></td>
+ <td class="listMRr nowrap"><?php echo $srcIP . $srcPort;?></td>
+ <td class="listMRr nowrap"><?php echo $dstIP . $dstPort;?></td>
+ <?php
+ if ($filterent['proto'] == "TCP") {
+ $filterent['proto'] .= ":{$filterent['tcpflags']}";
+ }
+ ?>
+ <td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
+ </tr>
+<?php
+ endforeach;
+?>
+ </tbody>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<p><span class="vexpl"><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</span></p>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php
index e4150a0..fe10383 100644
--- a/usr/local/www/diag_logs_filter_summary.php
+++ b/usr/local/www/diag_logs_filter_summary.php
@@ -189,7 +189,8 @@ include("head.inc"); ?>
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs filter summary">
- <tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -205,8 +206,10 @@ include("head.inc"); ?>
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr><td class="tabnavtbl">
+ </td>
+ </tr>
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Normal View"), false, "/diag_logs_filter.php");
@@ -214,13 +217,14 @@ include("head.inc"); ?>
$tab_array[] = array(gettext("Summary View"), true, "/diag_logs_filter_summary.php");
display_top_tabs($tab_array);
?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" summary="main area">
- <tr><td align="center">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" summary="main area">
+ <tr>
+ <td align="center">
<?php printf (gettext('This is a firewall log summary, of the last %1$s lines of the firewall log (Max %2$s).'), $gotlines, $lines)?><br />
<?=gettext("NOTE: IE8 users must enable compatibility view.")?>
@@ -233,10 +237,12 @@ foreach (array_keys($fields) as $field) {
echo "<br /><br />";
}
?>
- </td></tr></table>
- </div>
- </td>
- </tr>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/diag_logs_gateways.php b/usr/local/www/diag_logs_gateways.php
index 2991f2e..bb88615 100755
--- a/usr/local/www/diag_logs_gateways.php
+++ b/usr/local/www/diag_logs_gateways.php
@@ -69,7 +69,7 @@ if ($filtertext) {
$filtertextmeta="?filtertext=$filtertext";
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Gateways"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Gateways"));
$shortcut_section = "gateways";
include("head.inc");
@@ -115,7 +115,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"),$nentries); ?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"), $nentries); ?></td>
</tr>
<?php
if ($filtertext) {
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index ee932fd..9340571 100644
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -60,7 +60,7 @@ if ($_POST['clear']) {
$ipsec_logarr = return_clog($ipsec_logfile, $nentries);
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("IPsec VPN"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("IPsec VPN"));
$shortcut_section = "ipsec";
include("head.inc");
@@ -92,7 +92,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s IPsec log entries"),$nentries);?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s IPsec log entries"), $nentries);?></td>
</tr>
<?php
foreach ($ipsec_logarr as $logent) {
@@ -109,7 +109,7 @@ include("head.inc");
<td>
<br />
<form action="diag_logs_ipsec.php" method="post">
- <input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
+ <input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
</form>
</td>
</tr>
diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php
index 921ec23..d9f6bf5 100644
--- a/usr/local/www/diag_logs_ntpd.php
+++ b/usr/local/www/diag_logs_ntpd.php
@@ -54,7 +54,7 @@ if ($_POST['clear']) {
clear_log_file($ntpd_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("NTP"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("NTP"));
$shortcut_section = "ntp";
include("head.inc");
diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php
index c9e4bed..374014d 100644
--- a/usr/local/www/diag_logs_openvpn.php
+++ b/usr/local/www/diag_logs_openvpn.php
@@ -43,7 +43,7 @@
##|*MATCH=diag_logs_openvpn.php*
##|-PRIV
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("OpenVPN"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("OpenVPN"));
$shortcut_section = "openvpn";
require("guiconfig.inc");
@@ -90,7 +90,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s OpenVPN log entries"),$nentries)?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s OpenVPN log entries"), $nentries)?></td>
</tr>
<?php dump_clog($openvpn_logfile, $nentries); ?>
<tr>
diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php
index c56c7e0..4ef3f9c 100644
--- a/usr/local/www/diag_logs_ppp.php
+++ b/usr/local/www/diag_logs_ppp.php
@@ -57,7 +57,7 @@ if ($_POST['clear']) {
clear_log_file($ppp_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("PPP"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("PPP"));
include("head.inc");
?>
@@ -88,7 +88,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s PPP log entries"),$nentries);?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s PPP log entries"), $nentries);?></td>
</tr>
<?php dump_clog($ppp_logfile, $nentries); ?>
<tr>
diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php
index 053dbc9..5468761 100644
--- a/usr/local/www/diag_logs_relayd.php
+++ b/usr/local/www/diag_logs_relayd.php
@@ -55,7 +55,7 @@ if ($_POST['clear']) {
clear_log_file($relayd_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Load Balancer"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Load Balancer"));
$shortcut_section = "relayd";
include("head.inc");
@@ -89,7 +89,7 @@ include("head.inc");
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
<td colspan="2" class="listtopic">
- <?php printf(gettext("Last %s Load Balancer log entries"),$nentries);?>
+ <?php printf(gettext("Last %s Load Balancer log entries"), $nentries);?>
</td>
</tr>
<?php dump_clog($relayd_logfile, $nentries); ?>
diff --git a/usr/local/www/diag_logs_resolver.php b/usr/local/www/diag_logs_resolver.php
index 981d473..73e39a9 100755
--- a/usr/local/www/diag_logs_resolver.php
+++ b/usr/local/www/diag_logs_resolver.php
@@ -69,7 +69,7 @@ if ($filtertext) {
$filtertextmeta="?filtertext=$filtertext";
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Resolver"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Resolver"));
if (isset($config['dnsmasq']['enable'])) {
$shortcut_section = "forwarder";
} else {
@@ -120,7 +120,7 @@ include("head.inc");
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
- <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"),$nentries); ?></td>
+ <td colspan="2" class="listtopic"><?php printf(gettext("Last %s system log entries"), $nentries); ?></td>
</tr>
<?php
if ($filtertext) {
diff --git a/usr/local/www/diag_logs_routing.php b/usr/local/www/diag_logs_routing.php
index 0fdbc67..debbf18 100644
--- a/usr/local/www/diag_logs_routing.php
+++ b/usr/local/www/diag_logs_routing.php
@@ -54,7 +54,7 @@ if ($_POST['clear']) {
clear_log_file($routing_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Routing"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Routing"));
$shortcut_section = "routing";
include("head.inc");
@@ -101,7 +101,7 @@ include("head.inc");
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
<td colspan="2" class="listtopic">
- <?php printf(gettext("Routing daemon log entries"),$nentries);?>
+ <?php printf(gettext("Routing daemon log entries"), $nentries);?>
</td>
</tr>
<?php dump_clog($routing_logfile, $nentries); ?>
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php
index 9d1ecfa..c3d6993 100644
--- a/usr/local/www/diag_logs_settings.php
+++ b/usr/local/www/diag_logs_settings.php
@@ -264,7 +264,8 @@ function check_everything() {
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs settings">
-<tr><td>
+ <tr>
+ <td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -280,205 +281,230 @@ function check_everything() {
$tab_array[] = array(gettext("Settings"), true, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
-</td></tr>
-<tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
- <tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("General Logging Options");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">Forward/Reverse Display</td>
- <td width="78%" class="vtable"> <input name="reverse" type="checkbox" id="reverse" value="yes" <?php if ($pconfig['reverse']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Show log entries in reverse order (newest entries on top)");?></strong></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">GUI Log Entries to Display</td>
- <td width="78%" class="vtable">
- <input name="nentries" id="nentries" type="text" class="formfld unknown" size="4" value="<?=htmlspecialchars($pconfig['nentries']);?>" /><br />
- <?=gettext("Hint: This is only the number of log entries displayed in the GUI. It does not affect how many entries are contained in the actual log files.") ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">Log File Size (Bytes)</td>
- <td width="78%" class="vtable">
- <input name="logfilesize" id="logfilesize" type="text" class="formfld unknown" size="8" value="<?=htmlspecialchars($pconfig['logfilesize']);?>" /><br />
- <?=gettext("Logs are held in constant-size circular log files. This field controls how large each log file is, and thus how many entries may exist inside the log. By default this is approximately 500KB per log file, and there are nearly 20 such log files.") ?>
- <br /><br />
- <?=gettext("NOTE: Log sizes are changed the next time a log file is cleared or deleted. To immediately increase the size of the log files, you must first save the options to set the size, then clear all logs using the \"Reset Log Files\" option farther down this page. "); ?>
- <?=gettext("Be aware that increasing this value increases every log file size, so disk usage will increase significantly."); ?>
- <?=gettext("Disk space currently used by log files: ") ?><?= exec("/usr/bin/du -sh /var/log | /usr/bin/awk '{print $1;}'"); ?>.
- <?=gettext("Remaining disk space for log files: ") ?><?= exec("/bin/df -h /var/log | /usr/bin/awk '{print $4;}'"); ?>.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vtable">Log Firewall Default Blocks</td>
- <td class="vtable">
- <input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Log packets matched from the default block rules put in the ruleset");?></strong><br />
- <?=gettext("Hint: packets that are blocked by the implicit default block rule will not be logged if you uncheck this option. Per-rule logging options are still respected.");?>
- <br />
- <input name="logdefaultpass" type="checkbox" id="logdefaultpass" value="yes" <?php if ($pconfig['logdefaultpass']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Log packets matched from the default pass rules put in the ruleset");?></strong><br />
- <?=gettext("Hint: packets that are allowed by the implicit default pass rule will be logged if you check this option. Per-rule logging options are still respected.");?>
- <br />
- <input name="logbogons" type="checkbox" id="logbogons" value="yes" <?php if ($pconfig['logbogons']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Log packets blocked by 'Block Bogon Networks' rules");?></strong><br />
- <br />
- <input name="logprivatenets" type="checkbox" id="logprivatenets" value="yes" <?php if ($pconfig['logprivatenets']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Log packets blocked by 'Block Private Networks' rules");?></strong><br />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vtable">Web Server Log</td>
- <td class="vtable"> <input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?php if ($pconfig['loglighttpd']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Log errors from the web server process.");?></strong><br />
- <?=gettext("Hint: If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log.");?></td>
- </tr>
- <tr>
- <td valign="top" class="vtable">Raw Logs</td>
- <td class="vtable"> <input name="rawfilter" type="checkbox" id="rawfilter" value="yes" <?php if ($pconfig['rawfilter']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Show raw filter logs");?></strong><br />
- <?=gettext("Hint: If this is checked, filter logs are shown as generated by the packet filter, without any formatting. This will reveal more detailed information, but it is more difficult to read.");?></td>
- </tr>
- <tr>
- <td valign="top" class="vtable">Filter descriptions</td>
- <td class="vtable">
- <select name="filterdescriptions" id="filterdescriptions" >
- <option value="0"<?=!isset($pconfig['filterdescriptions'])?" selected=\"selected\"":""?>>Dont load descriptions</option>
- <option value="1"<?=($pconfig['filterdescriptions'])==="1"?" selected=\"selected\"":""?>>Display as column</option>
- <option value="2"<?=($pconfig['filterdescriptions'])==="2"?" selected=\"selected\"":""?>>Display as second row</option>
- </select>
- <strong><?=gettext("Show the applied rule description below or in the firewall log rows.");?></strong>
- <br />
- <?=gettext("Displaying rule descriptions for all lines in the log might affect performance with large rule sets.");?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">Local Logging</td>
- <td width="78%" class="vtable"> <input name="disablelocallogging" type="checkbox" id="disablelocallogging" value="yes" <?php if ($pconfig['disablelocallogging']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
- <?php if ($g['platform'] == "pfSense"): ?>
- <strong><?=gettext("Disable writing log files to the local disk");?></strong></td>
- <?php else: ?>
- <strong><?=gettext("Disable writing log files to the local RAM disk");?></strong></td>
- <?php endif; ?>
- </tr>
- <tr>
- <td width="22%" valign="top">Reset Logs</td>
- <td width="78%">
- <input name="resetlogs" type="submit" class="formbtn" value="<?=gettext("Reset Log Files"); ?>" onclick="return confirm('<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>')" />
- <br /><br />
- <?= gettext("Note: Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if you have made any setting changes."); ?>
- </td>
- </tr>
- <tr>
- <td colspan="2" valign="top">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Remote Logging Options");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
- <td width="78%" class="vtable">
- <select name="sourceip" class="formselect">
- <option value="">Default (any)</option>
- <?php $sourceips = get_possible_traffic_source_addresses(false);
- foreach ($sourceips as $sipvalue => $sipname):
- $selected = "";
- if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $pconfig['sourceip'])) {
- $selected = 'selected="selected"';
- }
- ?>
- <option value="<?=$sipvalue;?>" <?=$selected;?>>
- <?=htmlspecialchars($sipname);?>
- </option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("This option will allow the logging daemon to bind to a single IP address, rather than all IP addresses."); ?>
- <?= gettext("If you pick a single IP, remote syslog severs must all be of that IP type. If you wish to mix IPv4 and IPv6 remote syslog servers, you must bind to all interfaces."); ?>
- <br /><br />
- <?= gettext("NOTE: If an IP address cannot be located on the chosen interface, the daemon will bind to all addresses."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("IP Protocol"); ?></td>
- <td width="78%" class="vtable">
- <select name="ipproto" class="formselect">
- <option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
- <option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
- </select>
- <br />
- <?= gettext("This option is only used when a non-default address is chosen as the source above. This option only expresses a preference; If an IP address of the selected type is not found on the chosen interface, the other type will be tried."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Enable Remote Logging");?></td>
- <td width="78%" class="vtable"> <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
- <strong><?=gettext("Send log messages to remote syslog server");?></strong></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Servers");?></td>
- <td width="78%" class="vtable">
- <table summary="remtote syslog servers">
- <tr>
- <td><?=gettext("Server") . " 1";?></td>
- <td><input name="remoteserver" id="remoteserver" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver']);?>" /></td>
- </tr>
- <tr>
- <td><?=gettext("Server") . " 2";?></td>
- <td><input name="remoteserver2" id="remoteserver2" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver2']);?>" /></td>
- </tr>
- <tr>
- <td><?=gettext("Server") . " 3";?></td>
- <td><input name="remoteserver3" id="remoteserver3" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver3']);?>" /></td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td><?=gettext("IP addresses of remote syslog servers, or an IP:port.");?></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Contents");?></td>
- <td width="78%" class="vtable">
- <input name="logall" id="logall" type="checkbox" value="yes" <?php if ($pconfig['logall']) echo "checked=\"checked\""; ?> onclick="check_everything();" />
- <?=gettext("Everything");?><br /><br />
- <input name="system" id="system" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked=\"checked\""; ?> />
- <?=gettext("System events");?><br />
- <input name="filter" id="filter" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked=\"checked\""; ?> />
- <?=gettext("Firewall events");?><br />
- <input name="dhcp" id="dhcp" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked=\"checked\""; ?> />
- <?=gettext("DHCP service events");?><br />
- <input name="portalauth" id="portalauth" type="checkbox" value="yes" <?php if ($pconfig['portalauth']) echo "checked=\"checked\""; ?> />
- <?=gettext("Portal Auth events");?><br />
- <input name="vpn" id="vpn" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked=\"checked\""; ?> />
- <?=gettext("VPN (PPTP, IPsec, OpenVPN) events");?><br />
- <input name="apinger" id="apinger" type="checkbox" value="yes" <?php if ($pconfig['apinger']) echo "checked=\"checked\""; ?> />
- <?=gettext("Gateway Monitor events");?><br />
- <input name="relayd" id="relayd" type="checkbox" value="yes" <?php if ($pconfig['relayd']) echo "checked=\"checked\""; ?> />
- <?=gettext("Server Load Balancer events");?><br />
- <input name="hostapd" id="hostapd" type="checkbox" value="yes" <?php if ($pconfig['hostapd']) echo "checked=\"checked\""; ?> />
- <?=gettext("Wireless events");?><br />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"> <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
- </td>
- </tr>
- <tr>
- <td width="22%" height="53" valign="top">&nbsp;</td>
- <td width="78%"><strong><span class="red"><?=gettext("Note:")?></span></strong><br />
- <?=gettext("syslog sends UDP datagrams to port 514 on the specified " .
- "remote syslog server, unless another port is specified. Be sure to set syslogd on the " .
- "remote server to accept syslog messages from");?> <?=$g['product_name']?>.
- </td>
- </tr>
- </table>
- </div>
-</td></tr>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("General Logging Options");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">Forward/Reverse Display</td>
+ <td width="78%" class="vtable">
+ <input name="reverse" type="checkbox" id="reverse" value="yes" <?php if ($pconfig['reverse']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Show log entries in reverse order (newest entries on top)");?></strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">GUI Log Entries to Display</td>
+ <td width="78%" class="vtable">
+ <input name="nentries" id="nentries" type="text" class="formfld unknown" size="4" value="<?=htmlspecialchars($pconfig['nentries']);?>" /><br />
+ <?=gettext("Hint: This is only the number of log entries displayed in the GUI. It does not affect how many entries are contained in the actual log files.") ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">Log File Size (Bytes)</td>
+ <td width="78%" class="vtable">
+ <input name="logfilesize" id="logfilesize" type="text" class="formfld unknown" size="8" value="<?=htmlspecialchars($pconfig['logfilesize']);?>" /><br />
+ <?=gettext("Logs are held in constant-size circular log files. This field controls how large each log file is, and thus how many entries may exist inside the log. By default this is approximately 500KB per log file, and there are nearly 20 such log files.") ?>
+ <br /><br />
+ <?=gettext("NOTE: Log sizes are changed the next time a log file is cleared or deleted. To immediately increase the size of the log files, you must first save the options to set the size, then clear all logs using the \"Reset Log Files\" option farther down this page. "); ?>
+ <?=gettext("Be aware that increasing this value increases every log file size, so disk usage will increase significantly."); ?>
+ <?=gettext("Disk space currently used by log files: ") ?><?= exec("/usr/bin/du -sh /var/log | /usr/bin/awk '{print $1;}'"); ?>.
+ <?=gettext("Remaining disk space for log files: ") ?><?= exec("/bin/df -h /var/log | /usr/bin/awk '{print $4;}'"); ?>.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vtable">Log Firewall Default Blocks</td>
+ <td class="vtable">
+ <input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Log packets matched from the default block rules put in the ruleset");?></strong><br />
+ <?=gettext("Hint: packets that are blocked by the implicit default block rule will not be logged if you uncheck this option. Per-rule logging options are still respected.");?>
+ <br />
+ <input name="logdefaultpass" type="checkbox" id="logdefaultpass" value="yes" <?php if ($pconfig['logdefaultpass']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Log packets matched from the default pass rules put in the ruleset");?></strong><br />
+ <?=gettext("Hint: packets that are allowed by the implicit default pass rule will be logged if you check this option. Per-rule logging options are still respected.");?>
+ <br />
+ <input name="logbogons" type="checkbox" id="logbogons" value="yes" <?php if ($pconfig['logbogons']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Log packets blocked by 'Block Bogon Networks' rules");?></strong><br />
+ <br />
+ <input name="logprivatenets" type="checkbox" id="logprivatenets" value="yes" <?php if ($pconfig['logprivatenets']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Log packets blocked by 'Block Private Networks' rules");?></strong><br />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vtable">Web Server Log</td>
+ <td class="vtable">
+ <input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?php if ($pconfig['loglighttpd']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Log errors from the web server process.");?></strong><br />
+ <?=gettext("Hint: If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log.");?>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vtable">Raw Logs</td>
+ <td class="vtable">
+ <input name="rawfilter" type="checkbox" id="rawfilter" value="yes" <?php if ($pconfig['rawfilter']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Show raw filter logs");?></strong><br />
+ <?=gettext("Hint: If this is checked, filter logs are shown as generated by the packet filter, without any formatting. This will reveal more detailed information, but it is more difficult to read.");?>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vtable">Filter descriptions</td>
+ <td class="vtable">
+ <select name="filterdescriptions" id="filterdescriptions" >
+ <option value="0"<?=!isset($pconfig['filterdescriptions'])?" selected=\"selected\"":""?>>Dont load descriptions</option>
+ <option value="1"<?=($pconfig['filterdescriptions']) === "1"?" selected=\"selected\"":""?>>Display as column</option>
+ <option value="2"<?=($pconfig['filterdescriptions']) === "2"?" selected=\"selected\"":""?>>Display as second row</option>
+ </select>
+ <strong><?=gettext("Show the applied rule description below or in the firewall log rows.");?></strong>
+ <br />
+ <?=gettext("Displaying rule descriptions for all lines in the log might affect performance with large rule sets.");?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">Local Logging</td>
+ <td width="78%" class="vtable">
+ <input name="disablelocallogging" type="checkbox" id="disablelocallogging" value="yes" <?php if ($pconfig['disablelocallogging']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
+ <strong>
+ <?php if ($g['platform'] == "pfSense"): ?>
+ <?=gettext("Disable writing log files to the local disk");?>
+ <?php else: ?>
+ <?=gettext("Disable writing log files to the local RAM disk");?>
+ <?php endif; ?>
+ </strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">Reset Logs</td>
+ <td width="78%">
+ <input name="resetlogs" type="submit" class="formbtn" value="<?=gettext("Reset Log Files"); ?>" onclick="return confirm('<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>')" />
+ <br /><br />
+ <?= gettext("Note: Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if you have made any setting changes."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top">&nbsp;</td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Remote Logging Options");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="sourceip" class="formselect">
+ <option value="">Default (any)</option>
+ <?php
+ $sourceips = get_possible_traffic_source_addresses(false);
+ foreach ($sourceips as $sipvalue => $sipname):
+ $selected = "";
+ if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $pconfig['sourceip'])) {
+ $selected = 'selected="selected"';
+ }
+ ?>
+ <option value="<?=$sipvalue;?>" <?=$selected;?>>
+ <?=htmlspecialchars($sipname);?>
+ </option>
+ <?php
+ endforeach;
+ ?>
+ </select>
+ <br />
+ <?= gettext("This option will allow the logging daemon to bind to a single IP address, rather than all IP addresses."); ?>
+ <?= gettext("If you pick a single IP, remote syslog severs must all be of that IP type. If you wish to mix IPv4 and IPv6 remote syslog servers, you must bind to all interfaces."); ?>
+ <br /><br />
+ <?= gettext("NOTE: If an IP address cannot be located on the chosen interface, the daemon will bind to all addresses."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("IP Protocol"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="ipproto" class="formselect">
+ <option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
+ <option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
+ </select>
+ <br />
+ <?= gettext("This option is only used when a non-default address is chosen as the source above. This option only expresses a preference; If an IP address of the selected type is not found on the chosen interface, the other type will be tried."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Enable Remote Logging");?></td>
+ <td width="78%" class="vtable">
+ <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
+ <strong><?=gettext("Send log messages to remote syslog server");?></strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Servers");?></td>
+ <td width="78%" class="vtable">
+ <table summary="remtote syslog servers">
+ <tr>
+ <td><?=gettext("Server") . " 1";?></td>
+ <td><input name="remoteserver" id="remoteserver" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver']);?>" /></td>
+ </tr>
+ <tr>
+ <td><?=gettext("Server") . " 2";?></td>
+ <td><input name="remoteserver2" id="remoteserver2" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver2']);?>" /></td>
+ </tr>
+ <tr>
+ <td><?=gettext("Server") . " 3";?></td>
+ <td><input name="remoteserver3" id="remoteserver3" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver3']);?>" /></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><?=gettext("IP addresses of remote syslog servers, or an IP:port.");?></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Contents");?></td>
+ <td width="78%" class="vtable">
+ <input name="logall" id="logall" type="checkbox" value="yes" <?php if ($pconfig['logall']) echo "checked=\"checked\""; ?> onclick="check_everything();" />
+ <?=gettext("Everything");?><br /><br />
+ <input name="system" id="system" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked=\"checked\""; ?> />
+ <?=gettext("System events");?><br />
+ <input name="filter" id="filter" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked=\"checked\""; ?> />
+ <?=gettext("Firewall events");?><br />
+ <input name="dhcp" id="dhcp" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked=\"checked\""; ?> />
+ <?=gettext("DHCP service events");?><br />
+ <input name="portalauth" id="portalauth" type="checkbox" value="yes" <?php if ($pconfig['portalauth']) echo "checked=\"checked\""; ?> />
+ <?=gettext("Portal Auth events");?><br />
+ <input name="vpn" id="vpn" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked=\"checked\""; ?> />
+ <?=gettext("VPN (PPTP, IPsec, OpenVPN) events");?><br />
+ <input name="apinger" id="apinger" type="checkbox" value="yes" <?php if ($pconfig['apinger']) echo "checked=\"checked\""; ?> />
+ <?=gettext("Gateway Monitor events");?><br />
+ <input name="relayd" id="relayd" type="checkbox" value="yes" <?php if ($pconfig['relayd']) echo "checked=\"checked\""; ?> />
+ <?=gettext("Server Load Balancer events");?><br />
+ <input name="hostapd" id="hostapd" type="checkbox" value="yes" <?php if ($pconfig['hostapd']) echo "checked=\"checked\""; ?> />
+ <?=gettext("Wireless events");?><br />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" height="53" valign="top">&nbsp;</td>
+ <td width="78%">
+ <strong>
+ <span class="red">
+ <?=gettext("Note:")?>
+ </span>
+ </strong>
+ <br />
+ <?=gettext("syslog sends UDP datagrams to port 514 on the specified " .
+ "remote syslog server, unless another port is specified. Be sure to set syslogd on the " .
+ "remote server to accept syslog messages from");?> <?=$g['product_name']?>.
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
</form>
<script type="text/javascript">
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php
index be2de56..d1dc748 100755
--- a/usr/local/www/diag_logs_vpn.php
+++ b/usr/local/www/diag_logs_vpn.php
@@ -126,7 +126,8 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs vpn">
- <tr><td class="tabnavtbl">
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("System"), false, "diag_logs.php");
@@ -142,8 +143,10 @@ include("head.inc");
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr><td class="tabnavtbl">
+ </td>
+ </tr>
+ <tr>
+ <td class="tabnavtbl">
<?php
$tab_array = array();
$tab_array[] = array(gettext("PPTP Logins"),
@@ -166,34 +169,42 @@ include("head.inc");
"/diag_logs_vpn.php?vpntype=l2tp&amp;mode=raw");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr>
- <td class="tabcont">
- <form action="diag_logs_vpn.php" method="post">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
- <tr>
- <td colspan="4" class="listtopic">
- <?php printf(gettext('Last %1$s %2$s VPN log entries'),$nentries,$vpns[$vpntype]);?></td>
- </tr>
- <?php if ($mode != "raw"): ?>
- <tr>
- <td class="listhdrr"><?=gettext("Time");?></td>
- <td class="listhdrr"><?=gettext("Action");?></td>
- <td class="listhdrr"><?=gettext("User");?></td>
- <td class="listhdrr"><?=gettext("IP address");?></td>
- </tr>
- <?php dump_clog_vpn("/var/log/vpn.log", $nentries); ?>
- <?php else:
- dump_clog("/var/log/{$logname}.log", $nentries);
- endif; ?>
- </table>
- <br />
- <input type="hidden" name="vpntype" id="vpntype" value="<?=$vpntype;?>" />
- <input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
- <input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
- </form>
- </td>
- </tr>
+ </td>
+ </tr>
+ <tr>
+ <td class="tabcont">
+ <form action="diag_logs_vpn.php" method="post">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+ <tr>
+ <td colspan="4" class="listtopic">
+ <?php printf(gettext('Last %1$s %2$s VPN log entries'), $nentries, $vpns[$vpntype]);?>
+ </td>
+ </tr>
+ <?php
+ if ($mode != "raw"):
+ ?>
+ <tr>
+ <td class="listhdrr"><?=gettext("Time");?></td>
+ <td class="listhdrr"><?=gettext("Action");?></td>
+ <td class="listhdrr"><?=gettext("User");?></td>
+ <td class="listhdrr"><?=gettext("IP address");?></td>
+ </tr>
+ <?php
+ dump_clog_vpn("/var/log/vpn.log", $nentries);
+ ?>
+ <?php
+ else:
+ dump_clog("/var/log/{$logname}.log", $nentries);
+ endif;
+ ?>
+ </table>
+ <br />
+ <input type="hidden" name="vpntype" id="vpntype" value="<?=$vpntype;?>" />
+ <input type="hidden" name="mode" id="mode" value="<?=$mode;?>" />
+ <input name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log"); ?>" />
+ </form>
+ </td>
+ </tr>
</table>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/diag_logs_wireless.php b/usr/local/www/diag_logs_wireless.php
index 49998cf..4979d1e 100644
--- a/usr/local/www/diag_logs_wireless.php
+++ b/usr/local/www/diag_logs_wireless.php
@@ -56,7 +56,7 @@ if ($_POST['clear']) {
clear_log_file($wireless_logfile);
}
-$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Wireless"));
+$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Wireless"));
$shortcut_section = "wireless";
include("head.inc");
@@ -103,7 +103,7 @@ include("head.inc");
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="main area">
<tr>
<td colspan="2" class="listtopic">
- <?php printf(gettext("Wireless (hostapd) log entries"),$nentries);?>
+ <?php printf(gettext("Wireless (hostapd) log entries"), $nentries);?>
</td>
</tr>
<?php dump_clog($wireless_logfile, $nentries); ?>
OpenPOWER on IntegriCloud