summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-01-06 13:26:37 -0800
committerNOYB <Al_Stu@Frontier.com>2016-01-06 13:38:31 -0800
commit9855a2013d442cf7d55b9d36b9c60c0a6fa8dc41 (patch)
treede5a48fd962c626e4fb0d82e866050616d952eff /src
parentc407c84db57d361ce8d99f54125d38fbdd903836 (diff)
downloadpfsense-9855a2013d442cf7d55b9d36b9c60c0a6fa8dc41.zip
pfsense-9855a2013d442cf7d55b9d36b9c60c0a6fa8dc41.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')
-rw-r--r--src/usr/local/www/status_logs_vpn.php17
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) {
OpenPOWER on IntegriCloud