diff options
author | Phil Davis <phil.davis@inf.org> | 2015-04-19 18:00:00 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-04-19 18:00:00 +0545 |
commit | 5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e (patch) | |
tree | cd25c71caf551eb882f460ac6e1c32c8220fe58f /usr/local/www/diag_dump_states_sources.php | |
parent | 0608bd3c354ea76eb6df9ed9322e2ef8686f15e7 (diff) | |
download | pfsense-5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e.zip pfsense-5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e.tar.gz |
Code style usr-local-www diag
Diffstat (limited to 'usr/local/www/diag_dump_states_sources.php')
-rw-r--r-- | usr/local/www/diag_dump_states_sources.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/usr/local/www/diag_dump_states_sources.php b/usr/local/www/diag_dump_states_sources.php index ca01d32..e46a316 100644 --- a/usr/local/www/diag_dump_states_sources.php +++ b/usr/local/www/diag_dump_states_sources.php @@ -29,7 +29,7 @@ */ /* - pfSense_BUILDER_BINARIES: /sbin/pfctl + pfSense_BUILDER_BINARIES: /sbin/pfctl pfSense_MODULE: filter */ @@ -43,8 +43,8 @@ require_once("guiconfig.inc"); /* handle AJAX operations */ -if($_GET['action']) { - if($_GET['action'] == "remove") { +if ($_GET['action']) { + if ($_GET['action'] == "remove") { if (is_ipaddr($_GET['srcip']) and is_ipaddr($_GET['dstip'])) { $retval = mwexec("/sbin/pfctl -K " . escapeshellarg($_GET['srcip']) . " -K " . escapeshellarg($_GET['dstip'])); echo htmlentities("|{$_GET['srcip']}|{$_GET['dstip']}|{$retval}|"); @@ -56,10 +56,9 @@ if($_GET['action']) { } /* get our states */ -if($_GET['filter']) { +if ($_GET['filter']) { exec("/sbin/pfctl -s Sources | grep " . escapeshellarg(htmlspecialchars($_GET['filter'])), $sources); -} -else { +} else { exec("/sbin/pfctl -s Sources", $sources); } @@ -92,7 +91,7 @@ include("head.inc"); function removeComplete(req) { var values = req.responseText.split("|"); - if(values[3] != "0") { + if (values[3] != "0") { alert('<?=gettext("An error occurred.");?>'); return; } @@ -154,10 +153,11 @@ include("head.inc"); <tbody> <?php $row = 0; -if(count($sources) > 0) { - foreach($sources as $line) { - if($row >= 1000) +if (count($sources) > 0) { + foreach ($sources as $line) { + if ($row >= 1000) { break; + } // 192.168.20.2 -> 216.252.56.1 ( states 10, connections 0, rate 0.0/0s ) @@ -185,8 +185,7 @@ if(count($sources) > 0) { <?php $row++; } -} -else { +} else { echo "<tr> <td class='list' colspan='5' align='center' valign='top'> " . gettext("No source tracking entries were found.") . " |