diff options
author | jim-p <jimp@pfsense.org> | 2011-05-19 14:47:56 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-05-19 14:47:56 -0400 |
commit | 43a68abc9d16878cedac8ffda46fc12af5bb18ef (patch) | |
tree | c7acfa1d507aabf5772a773616b509a0f43087a4 /usr/local/www | |
parent | 51f8a7f8d553ff4418168e9840b0f01a49e9ed6f (diff) | |
download | pfsense-43a68abc9d16878cedac8ffda46fc12af5bb18ef.zip pfsense-43a68abc9d16878cedac8ffda46fc12af5bb18ef.tar.gz |
Fix clearing of PPTP/PPPoE/L2TP server raw logs. Fixes #1340
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/diag_logs_vpn.php | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php index adef3e1..658b5bb 100755 --- a/usr/local/www/diag_logs_vpn.php +++ b/usr/local/www/diag_logs_vpn.php @@ -49,11 +49,38 @@ $nentries = $config['syslog']['nentries']; if (!$nentries) $nentries = 50; -$vpntype = (htmlspecialchars($_GET['vpntype'])) ? htmlspecialchars($_GET['vpntype']) : "pptp"; -$mode = (htmlspecialchars($_GET['mode'])) ? htmlspecialchars($_GET['mode']) : "login"; +if (htmlspecialchars($_POST['vpntype'])) + $vpntype = htmlspecialchars($_POST['vpntype']); +elseif (htmlspecialchars($_GET['vpntype'])) + $vpntype = htmlspecialchars($_GET['vpntype']); +else + $vpntype = "pptp"; + +if (htmlspecialchars($_POST['mode'])) + $mode = htmlspecialchars($_POST['mode']); +elseif (htmlspecialchars($_GET['mode'])) + $mode = htmlspecialchars($_GET['mode']); +else + $mode = "login"; + +switch ($vpntype) { + case 'pptp': + $logname = "pptps"; + break; + case 'poes': + $logname = "poes"; + break; + case 'l2tp': + $logname = "l2tps"; + break; +} -if ($_POST['clear']) - clear_log_file("/var/log/vpn.log"); +if ($_POST['clear']) { + if ($mode != "raw") + clear_log_file("/var/log/vpn.log"); + else + clear_log_file("/var/log/{$logname}.log"); +} function dump_clog_vpn($logfile, $tail) { global $g, $config, $vpntype; @@ -151,22 +178,12 @@ include("head.inc"); </tr> <?php dump_clog_vpn("/var/log/vpn.log", $nentries); ?> <?php else: - switch ($vpntype) { - case 'pptp': - $logname = "pptps"; - break; - case 'poes': - $logname = "poes"; - break; - case 'l2tp': - $logname = "l2tps"; - break; - } 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> |