summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-11-01 17:02:22 -0400
committerjim-p <jimp@pfsense.org>2010-11-01 17:02:22 -0400
commit14905d9fce1261bd69f138af107808d15a8f90a5 (patch)
treeea032271e5fa57171617af5a9033dfab4e6f67cb /usr
parent917b0a566a492a8277590390807bab68ebf59c6b (diff)
downloadpfsense-14905d9fce1261bd69f138af107808d15a8f90a5.zip
pfsense-14905d9fce1261bd69f138af107808d15a8f90a5.tar.gz
Show login/logout events for pptp, pppoe server, and l2tp. Could use some work to simplify. Ticket #912.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_logs_vpn.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php
index 8c36eb0..025663d 100755
--- a/usr/local/www/diag_logs_vpn.php
+++ b/usr/local/www/diag_logs_vpn.php
@@ -57,10 +57,10 @@ if ($_POST['vpntype'])
$vpntype = $_POST['vpntype'];
if ($_POST['clear'])
- clear_log_file("/var/log/{$vpntype}.log");
+ clear_log_file("/var/log/vpn.log");
function dump_clog_vpn($logfile, $tail) {
- global $g, $config;
+ global $g, $config, $vpntype;
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
@@ -74,17 +74,18 @@ function dump_clog_vpn($logfile, $tail) {
foreach ($logarr as $logent) {
$logent = preg_split("/\s+/", $logent, 6);
$llent = explode(",", $logent[5]);
-
+ if ($llent[0] != $vpntype)
+ continue;
echo "<tr>\n";
echo "<td class=\"listlr\" nowrap>" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n";
- if ($llent[0] == "login")
+ if ($llent[1] == "login")
echo "<td class=\"listr\"><img src=\"/themes/{$g['theme']}/images/icons/icon_in.gif\" width=\"11\" height=\"11\" title=\"login\"></td>\n";
else
echo "<td class=\"listr\"><img src=\"/themes/{$g['theme']}/images/icons/icon_out.gif\" width=\"11\" height=\"11\" title=\"logout\"></td>\n";
- echo "<td class=\"listr\">" . htmlspecialchars($llent[3]) . "</td>\n";
- echo "<td class=\"listr\">" . htmlspecialchars($llent[2]) . "&nbsp;</td>\n";
+ echo "<td class=\"listr\">" . htmlspecialchars($llent[4]) . "</td>\n";
+ echo "<td class=\"listr\">" . htmlspecialchars($llent[3]) . "&nbsp;</td>\n";
echo "</tr>\n";
}
}
@@ -139,7 +140,7 @@ include("head.inc");
<td class="listhdrr"><?=gettext("User");?></td>
<td class="listhdrr"><?=gettext("IP address");?></td>
</tr>
- <?php dump_clog_vpn("/var/log/{$vpntype}.log", $nentries); ?>
+ <?php dump_clog_vpn("/var/log/vpn.log", $nentries); ?>
</table>
<br />
<input type="hidden" name="vpntype" id="vpntype" value="<?=$vpntype;?>">
OpenPOWER on IntegriCloud