diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-01-06 13:26:37 -0800 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-01-07 13:29:29 -0500 |
commit | 1fdb771b9308260e4ea227863efde0cb89ade06f (patch) | |
tree | 12f525b815aa693dc7f2fefe4171de60bf10354a /src/usr/local/www/status_logs_vpn.php | |
parent | f372bd5b992b3a3b4e18a73bcaa13bd19a228a1a (diff) | |
download | pfsense-1fdb771b9308260e4ea227863efde0cb89ade06f.zip pfsense-1fdb771b9308260e4ea227863efde0cb89ade06f.tar.gz |
Use the log file path provide from status_logs_common.inc
Apply a better way of filtering the vpn type that also provides the count of only the selected type (unset record from the array).
Diffstat (limited to 'src/usr/local/www/status_logs_vpn.php')
-rw-r--r-- | src/usr/local/www/status_logs_vpn.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/usr/local/www/status_logs_vpn.php b/src/usr/local/www/status_logs_vpn.php index 17def8a..4551883 100644 --- a/src/usr/local/www/status_logs_vpn.php +++ b/src/usr/local/www/status_logs_vpn.php @@ -97,8 +97,6 @@ if (!$_GET['logfile']) { if ($vpntype == 'poes') { $allowed_logs['vpn']['name'] = "PPPoE Logins"; } if ($vpntype == 'l2tp') { $allowed_logs['vpn']['name'] = "L2TP Logins"; } -$vpn_logfile = "{$g['varlog_path']}/" . basename($logfile) . ".log"; - // Log Filter Submit - VPN log_filter_form_vpn_submit(); @@ -137,9 +135,16 @@ filter_form_vpn(); // Now the forms are complete we can draw the log table and its controls if (!$rawfilter) { if ($filterlogentries_submit) { - $filterlog = conv_log_filter($vpn_logfile, $nentries, $nentries + 100, $filterfieldsarray); + $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filterfieldsarray); } else { - $filterlog = conv_log_filter($vpn_logfile, $nentries, $nentries + 100, $filtertext); + $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filtertext); + } + + // Remove those not of the selected vpn type (poes / l2tp). + foreach ($filterlog as $key => $filterent) { + if (!preg_match('/' . $vpntype . '/', $filterent['type'])) { + unset($filterlog[$key]); + } } ?> @@ -174,7 +179,6 @@ if (!$rawfilter) { <tbody> <?php foreach ($filterlog as $filterent) { - if (preg_match('/' . $vpntype . '/', $filterent['type'])) { ?> <tr class="text-nowrap"> <td> @@ -195,7 +199,6 @@ if (!$rawfilter) { </td> </tr> <?php - } } // e-o-foreach ?> </tbody> @@ -251,7 +254,7 @@ if (!$rawfilter) { <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=gettext($allowed_logs[$logfile]["name"])?><?=gettext(" log entries")?></h2></div> <div class="panel-body"> <pre><?php - $rows = dump_clog_no_table($vpn_logfile, $nentries, true, array($filtertext)); + $rows = dump_clog_no_table($logfile_path, $nentries, true, array($filtertext)); ?></pre> <?php if ($rows == 0) { |