From 9855a2013d442cf7d55b9d36b9c60c0a6fa8dc41 Mon Sep 17 00:00:00 2001 From: NOYB Date: Wed, 6 Jan 2016 13:26:37 -0800 Subject: 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). --- src/usr/local/www/status_logs_vpn.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') 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) { @@ -195,7 +199,6 @@ if (!$rawfilter) { @@ -251,7 +254,7 @@ if (!$rawfilter) {