Commit ee567e36 authored by Ad Schellevis's avatar Ad Schellevis

whitespace, unused classes in diag_logs_filter_dynamic.php

parent 41232ca5
<?php <?php
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004-2009 Scott Ullrich Copyright (C) 2004-2009 Scott Ullrich
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -42,7 +42,7 @@ $nentries = 50; ...@@ -42,7 +42,7 @@ $nentries = 50;
handle_ajax($nentries, $nentries + 20); handle_ajax($nentries, $nentries + 20);
if (isset($_POST['clear'])) { if (isset($_POST['clear'])) {
clear_clog($filter_logfile); clear_clog($filter_logfile);
} }
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100); $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
...@@ -54,116 +54,113 @@ include("head.inc"); ...@@ -54,116 +54,113 @@ include("head.inc");
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
lastsawtime = '<?php echo time(); ?>;'; lastsawtime = '<?=time(); ?>;';
var lines = Array(); var lines = Array();
var timer; var timer;
var updateDelay = 25500; var updateDelay = 25500;
var isBusy = false; var isBusy = false;
var isPaused = false; var isPaused = false;
var nentries = <?php echo $nentries; ?>; var nentries = <?=$nentries; ?>;
<?php <?php
if(isset($config['syslog']['reverse'])) if(isset($config['syslog']['reverse']))
echo "var isReverse = true;\n"; echo "var isReverse = true;\n";
else else
echo "var isReverse = false;\n"; echo "var isReverse = false;\n";
?> ?>
/* Called by the AJAX updater */ /* Called by the AJAX updater */
function format_log_line(row) { function format_log_line(row) {
var i = 0; var i = 0;
var line = '<td class="listMRlr nowrap" align="center">' + row[i++] + '<\/td>'; var line = '<td>' + row[i++] + '<\/td>';
while (i < 6) { while (i < 6) {
line += '<td class="listMRr nowrap">' + row[i++] + '<\/td>'; line += '<td>' + row[i++] + '<\/td>';
} }
return line; return line;
} }
//]]> //]]>
</script> </script>
<script src="/javascript/filter_log.js" type="text/javascript"></script> <script src="/javascript/filter_log.js" type="text/javascript"></script>
<section class="page-content-main">
<div class="container-fluid">
<section class="page-content-main"> <div class="row">
<div class="container-fluid"> <?php print_service_banner('firewall'); ?>
<div class="row"> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<?php print_service_banner('firewall'); ?> <div class="tab-content content-box col-xs-12">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <div class="table-responsive">
<table class="table table-striped table-sort">
<section class="col-xs-12"> <thead>
<tr>
<div class="tab-content content-box col-xs-12"> <td colspan="6">
<strong><?php printf(gettext("Showing last %s records."),$nentries);?></strong>
<div class="table-responsive"> </td>
<table class="table table-striped table-sort"> </tr>
<thead> <tr>
<tr> <td colspan="5">
<td colspan="6" class="listtopic"> <input type="checkbox" onclick="javascript:toggle_pause();" />&nbsp;<?=gettext("Pause");?>
<strong><?php printf(gettext("Showing last %s records."),$nentries);?></strong> </td>
</td> <td>
</tr> <form method="post">
<tr> <div class="pull-right">
<td colspan="5" class="listtopic"> <input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
<input type="checkbox" onclick="javascript:toggle_pause();" />&nbsp;<?=gettext("Pause");?> &nbsp;
</td> </div>
<td> </form>
<form method="post"> </td>
<div class="pull-right"> </tr>
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" /> <tr>
&nbsp; <td><?=gettext("Act");?></td>
</div> <td><?=gettext("Time");?></td>
</form> <td><?=gettext("If");?></td>
</td> <td><?=gettext("Source");?></td>
</tr> <td><?=gettext("Destination");?></td>
<tr> <td><?=gettext("Proto");?></td>
<td class="listhdrr" width="60"><?=gettext("Act");?></td> </tr>
<td class="listhdrr"><?=gettext("Time");?></td> </thead>
<td class="listhdrr"><?=gettext("If");?></td> <tbody id="filter-log-entries">
<td class="listhdrr"><?=gettext("Source");?></td> <?php
<td class="listhdrr"><?=gettext("Destination");?></td> $rowIndex = 0;
<td class="listhdrr"><?=gettext("Proto");?></td> foreach ($filterlog as $filterent):
</tr> $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
</thead> $rowIndex++;?>
<tbody id="filter-log-entries"> <tr class="<?=$evenRowClass?>">
<?php <td>
$rowIndex = 0; <a href="#" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['act']}"; ?>', outputrule);" title="<?=$filterent['act'];?>">
foreach ($filterlog as $filterent): <span class="glyphicon glyphicon-<?php
$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd"; switch ($filterent['act']) {
$rowIndex++;?> case 'pass':
<tr class="<?=$evenRowClass?>"> echo "play"; /* icon triangle */
<td class="listMRlr nowrap" align="center"> break;
<a href="#" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo "{$filterent['rulenum']},{$filterent['act']}"; ?>', outputrule);" title="<?php echo $filterent['act'];?>"><span class="glyphicon glyphicon-<?php switch ($filterent['act']) { case 'match':
case 'pass': echo "random";
echo "play"; /* icon triangle */ break;
break; case 'reject':
case 'match': case 'block':
echo "random"; default:
break; echo 'remove'; /* a x*/
case 'reject': break;
case 'block': }?>">
default: </span>
echo 'remove'; /* a x*/ </a>
break; </td>
} <td><?=htmlspecialchars($filterent['time']);?></td>
?>"></span> <td><?=htmlspecialchars($filterent['interface']);?></td>
</a> <td><?=htmlspecialchars($filterent['src']);?></td>
</td> <td><?=htmlspecialchars($filterent['dst']);?></td>
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td> <?php
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['interface']);?></td> if ($filterent['proto'] == "TCP") {
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['src']);?></td> $filterent['proto'] .= ":{$filterent['tcpflags']}";
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['dst']);?></td> }?>
<?php <td><?=htmlspecialchars($filterent['proto']);?></td>
if ($filterent['proto'] == "TCP") </tr>
$filterent['proto'] .= ":{$filterent['tcpflags']}"; <?php
?> endforeach; ?>
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td> </tbody>
</tr> </table>
<?php endforeach; ?> </div>
<tr style="display:none;"><td></td></tr> </div>
</tbody> </section>
</table> </div>
</div> </div>
</section> </section>
</div>
</div>
</section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment