Commit 72ab9e21 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) spaces, curly braces etc diag_logs_filter.php

(cherry picked from commit db3601f4)
parent 9e3def1a
......@@ -46,30 +46,36 @@ function easyrule_find_rule_interface($int) {
/* Borrowed from firewall_rules.php */
$iflist = get_configured_interface_with_descr(false, true);
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server")
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server") {
$iflist['pptp'] = "PPTP VPN";
}
if (isset($config['pppoe']['mode']) && $config['pppoe']['mode'] == "server")
if (isset($config['pppoe']['mode']) && $config['pppoe']['mode'] == "server") {
$iflist['pppoe'] = "PPPoE VPN";
}
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server")
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server") {
$iflist['l2tp'] = "L2TP VPN";
}
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])){
$iflist["enc0"] = "IPSEC";
}
if (isset($iflist[$int]))
if (isset($iflist[$int])) {
return $int;
}
foreach ($iflist as $if => $ifd) {
if (strtolower($int) == strtolower($ifd))
if (strtolower($int) == strtolower($ifd)) {
return $if;
}
}
if (substr($int, 0, 4) == "ovpn")
if (substr($int, 0, 4) == "ovpn") {
return "openvpn";
}
return false;
}
......@@ -84,12 +90,14 @@ function easyrule_block_rule_exists($int = 'wan', $ipproto = "inet") {
/* Search through the rules for one referencing our alias */
foreach ($config['filter']['rule'] as $rule) {
if (!is_array($rule) || !is_array($rule['source']))
if (!is_array($rule) || !is_array($rule['source'])) {
continue;
}
$checkproto = isset($rule['ipprotocol']) ? $rule['ipprotocol'] : "inet";
if ($rule['source']['address'] == $blockaliasname . strtoupper($int) && ($rule['interface'] == $int) && ($checkproto == $ipproto))
if ($rule['source']['address'] == $blockaliasname . strtoupper($int) && ($rule['interface'] == $int) && ($checkproto == $ipproto)) {
return true;
}
}
return false;
}
......@@ -98,12 +106,14 @@ function easyrule_block_rule_create($int = 'wan', $ipproto = "inet") {
$blockaliasname = 'EasyRuleBlockHosts';
/* If the alias doesn't exist, exit.
* Can't create an empty alias, and we don't know a host */
if (easyrule_block_alias_getid($int) === false)
if (easyrule_block_alias_getid($int) === false) {
return false;
}
/* If the rule already exists, no need to do it again */
if (easyrule_block_rule_exists($int, $ipproto))
if (easyrule_block_rule_exists($int, $ipproto)) {
return true;
}
/* No rules, start a new array */
if (!is_array($config['filter']['rule'])) {
......@@ -153,8 +163,9 @@ function easyrule_block_alias_add($host, $int = 'wan') {
$blockaliasname = 'EasyRuleBlockHosts';
/* If the host isn't a valid IP address, bail */
$host = trim($host, "[]");
if (!is_ipaddr($host) && !is_subnet($host))
if (!is_ipaddr($host) && !is_subnet($host)) {
return false;
}
/* If there are no aliases, start an array */
if (!isset($config['aliases']) || !is_array($config['aliases'])) {
......@@ -167,8 +178,9 @@ function easyrule_block_alias_add($host, $int = 'wan') {
/* Try to get the ID if the alias already exists */
$id = easyrule_block_alias_getid($int);
if ($id === false)
if ($id === false) {
unset($id);
}
$alias = array();
if (is_subnet($host)) {
......@@ -183,8 +195,9 @@ function easyrule_block_alias_add($host, $int = 'wan') {
if (isset($id) && $a_aliases[$id]) {
/* Make sure this IP isn't already in the list. */
if (in_array($host.'/'.$mask, explode(" ", $a_aliases[$id]['address'])))
if (in_array($host.'/'.$mask, explode(" ", $a_aliases[$id]['address']))) {
return true;
}
/* Since the alias already exists, just add to it. */
$alias['name'] = $a_aliases[$id]['name'];
$alias['type'] = $a_aliases[$id]['type'];
......@@ -203,10 +216,11 @@ function easyrule_block_alias_add($host, $int = 'wan') {
}
/* Replace the old alias if needed, otherwise tack it on the end */
if (isset($id) && $a_aliases[$id])
if (isset($id) && $a_aliases[$id]) {
$a_aliases[$id] = $alias;
else
} else {
$a_aliases[] = $alias;
}
// Sort list
$a_aliases = msort($a_aliases, "name");
......@@ -218,8 +232,9 @@ function easyrule_block_host_add($host, $int = 'wan', $ipproto = "inet") {
global $retval;
/* Bail if the supplied host is not a valid IP address */
$host = trim($host, "[]");
if (!is_ipaddr($host) && !is_subnet($host))
if (!is_ipaddr($host) && !is_subnet($host)) {
return false;
}
/* Flag whether or not we need to reload the filter */
$dirty = false;
......@@ -273,18 +288,21 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipp
$filterent['ipprotocol'] = $ipproto;
$filterent['descr'] = gettext("Easy Rule: Passed from Firewall Log View");
if ($proto != "any")
if ($proto != "any") {
$filterent['protocol'] = $proto;
else
} else {
unset($filterent['protocol']);
}
/* Default to only allow echo requests, since that's what most people want and
* it should be a safe choice. */
if ($proto == "icmp")
if ($proto == "icmp") {
$filterent['icmptype'] = 'echoreq';
}
if ((strtolower($proto) == "icmp6") || (strtolower($proto) == "icmpv6"))
if ((strtolower($proto) == "icmp6") || (strtolower($proto) == "icmpv6")) {
$filterent['protocol'] = "icmp";
}
if (is_subnet($srchost)) {
list($srchost, $srcmask) = explode("/", $srchost);
......@@ -384,8 +402,9 @@ function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0, $ipproto =
********************************************************************************************************************/
function get_port_with_service($port, $proto) {
if (!$port)
if (!$port) {
return '';
}
$service = getservbyport($port, $proto);
$portstr = "";
......@@ -400,24 +419,26 @@ function get_port_with_service($port, $proto) {
function find_rule_by_number($rulenum, $type = 'block')
{
/* Passing arbitrary input to grep could be a Very Bad Thing(tm) */
if (!is_numeric($rulenum) || !in_array($type, array('pass', 'block', 'match', 'rdr')))
if (!is_numeric($rulenum) || !in_array($type, array('pass', 'block', 'match', 'rdr'))) {
return;
}
$lookup_pattern = "^@{$rulenum}[[:space:]]{$type}[[:space:]].*[[:space:]]log[[:space:]]";
/* At the moment, miniupnpd is the only thing I know of that
generates logging rdr rules */
unset($buffer);
if ($type == "rdr")
if ($type == "rdr") {
$_gb = exec("/sbin/pfctl -vvPsn -a \"miniupnpd\" | /usr/bin/egrep " . escapeshellarg("^@{$rulenum}"), $buffer);
else {
} else {
if (file_exists('/tmp/rules.debug')) {
$_gb = exec('/sbin/pfctl -vvPnf /tmp/rules.debug 2>/dev/null | /usr/bin/egrep ' . escapeshellarg($lookup_pattern), $buffer);
} else {
$_gb = exec('/sbin/pfctl -vvPsr | /usr/bin/egrep ' . escapeshellarg($lookup_pattern), $buffer);
}
}
if (is_array($buffer))
if (is_array($buffer)) {
return $buffer[0];
}
return "";
}
......@@ -493,17 +514,16 @@ if (isset($_POST['resolve'])) {
$ip = strtolower($_POST['resolve']);
$res = (is_ipaddr($ip) ? gethostbyaddr($ip) : '');
if ($res && $res != $ip)
if ($res && $res != $ip) {
$response = array('resolve_ip' => $ip, 'resolve_text' => $res);
else
} else {
$response = array('resolve_ip' => $ip, 'resolve_text' => gettext("Cannot resolve"));
}
echo json_encode(str_replace("\\","\\\\", $response)); // single escape chars can break JSON decode
exit;
}
if (isset($_POST['easyrule'])) {
$response = array("status"=>"unknown") ;
switch ($_POST['easyrule']) {
case 'block':
......@@ -516,7 +536,6 @@ if (isset($_POST['easyrule'])) {
break;
}
echo json_encode(str_replace("\\","\\\\", $response));
exit;
}
......@@ -524,15 +543,17 @@ if (isset($_POST['easyrule'])) {
function getGETPOSTsettingvalue($settingname, $default)
{
$settingvalue = $default;
if(isset($_GET[$settingname]))
if (isset($_GET[$settingname])) {
$settingvalue = $_GET[$settingname];
if(isset($_POST[$settingname]))
}
if (isset($_POST[$settingname])) {
$settingvalue = $_POST[$settingname];
}
return $settingvalue;
}
$rulenum = getGETPOSTsettingvalue('getrulenum', null);
if($rulenum) {
if ($rulenum) {
list($rulenum, $type) = explode(',', $rulenum);
$rule = find_rule_by_number($rulenum, $type);
echo gettext("The rule that triggered this action is") . ":\n\n{$rule}";
......@@ -590,30 +611,23 @@ if (isset($_POST['clear'])) {
}
include("head.inc");
?>
<script src="/javascript/filter_log.js" type="text/javascript"></script>
<body>
<?php include("fbegin.inc"); ?>
<script src="/javascript/filter_log.js" type="text/javascript"></script>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php print_service_banner('firewall'); ?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="tab-content content-box col-xs-12">
<form id="filterlogentries" name="filterlogentries" action="diag_logs_filter.php" method="post">
<?php
<?php
$Include_Act = explode(",", str_replace(" ", ",", $filterfieldsarray['act']));
if ($filterfieldsarray['interface'] == "All") $interface = "";
?>
<div class="table-responsive widgetconfigdiv" id="filterlogentries_show">
?>
<div class="table-responsive" id="filterlogentries_show">
<table class="table table-striped">
<thead>
<tr>
......@@ -632,11 +646,21 @@ include("head.inc");
<input id="actpass" name="actpass" type="checkbox" value="Pass" <?php if (in_arrayi('Pass', $Include_Act)) echo "checked=\"checked\""; ?> />&nbsp;&nbsp;Pass
</label>
</td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Time') ?>" id="filterlogentries_time" name="filterlogentries_time" value="<?= $filterfieldsarray['time'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Source IP Address') ?>" id="filterlogentries_sourceipaddress" name="filterlogentries_sourceipaddress" value="<?= $filterfieldsarray['srcip'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Source Port') ?>" id="filterlogentries_sourceport" name="filterlogentries_sourceport" value="<?= $filterfieldsarray['srcport'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Protocol') ?>" id="filterlogentries_protocol" name="filterlogentries_protocol" value="<?= $filterfieldsarray['proto'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Quantity') ?>" id="filterlogentries_qty" name="filterlogentries_qty" value="<?= $filterlogentries_qty ?>"></td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Time') ?>" id="filterlogentries_time" name="filterlogentries_time" value="<?= $filterfieldsarray['time'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Source IP Address') ?>" id="filterlogentries_sourceipaddress" name="filterlogentries_sourceipaddress" value="<?= $filterfieldsarray['srcip'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Source Port') ?>" id="filterlogentries_sourceport" name="filterlogentries_sourceport" value="<?= $filterfieldsarray['srcport'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Protocol') ?>" id="filterlogentries_protocol" name="filterlogentries_protocol" value="<?= $filterfieldsarray['proto'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Quantity') ?>" id="filterlogentries_qty" name="filterlogentries_qty" value="<?= $filterlogentries_qty ?>">
</td>
</tr>
<tr>
<td>
......@@ -644,10 +668,18 @@ include("head.inc");
<input id="actblock" name="actblock" type="checkbox" value="Block" <?php if (in_arrayi('Block', $Include_Act)) echo "checked=\"checked\""; ?> /> &nbsp;&nbsp;Block
</label>
</td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Interface') ?>" id="filterlogentries_interfaces" name="filterlogentries_interfaces" value="<?= $filterfieldsarray['interface'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Destination IP Address') ?>" id="filterlogentries_destinationipaddress" name="filterlogentries_destinationipaddress" value="<?= $filterfieldsarray['dstip'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Destination Port') ?>" id="filterlogentries_destinationport" name="filterlogentries_destinationport" value="<?= $filterfieldsarray['dstport'] ?>"></td>
<td><input type="text" class="form-control" placeholder="<?= gettext('Protocol Flags') ?>" id="filterlogentries_protocolflags" name="filterlogentries_protocolflags" value="<?= $filterfieldsarray['tcpflags'] ?>"></td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Interface') ?>" id="filterlogentries_interfaces" name="filterlogentries_interfaces" value="<?= $filterfieldsarray['interface'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Destination IP Address') ?>" id="filterlogentries_destinationipaddress" name="filterlogentries_destinationipaddress" value="<?= $filterfieldsarray['dstip'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Destination Port') ?>" id="filterlogentries_destinationport" name="filterlogentries_destinationport" value="<?= $filterfieldsarray['dstport'] ?>">
</td>
<td>
<input type="text" class="form-control" placeholder="<?= gettext('Protocol Flags') ?>" id="filterlogentries_protocolflags" name="filterlogentries_protocolflags" value="<?= $filterfieldsarray['tcpflags'] ?>">
</td>
<td>
<select class="form-control" id="filterlogentries_version" name="filterlogentries_version">
<?php
......@@ -662,7 +694,7 @@ include("head.inc");
</tr>
<tr>
<td colspan="6">
<span class="vexpl"><a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol">TCP Flags</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, W - CWR</span>
<span><a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol">TCP Flags</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, W - CWR</span>
</td>
</tr>
<tr>
......@@ -676,59 +708,59 @@ include("head.inc");
</tbody>
</table>
</div>
</form>
</div>
</section>
<section class="col-xs-12">
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped table-sort">
<?php
<table class="table table-striped">
<?php
$iflist = get_configured_interface_with_descr(false, true);
if (isset($iflist[$interfacefilter]))
if (isset($iflist[$interfacefilter])) {
$interfacefilter = $iflist[$interfacefilter];
if (isset($filtersubmit))
}
if (isset($filtersubmit)) {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
else
} else {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
?>
}
?>
<tr>
<td colspan="<?=isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions']==="1"?7:6?>" class="listtopic">
<td colspan="<?=isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions']==="1"?7:6?>">
<strong>
<?php if ( (!$filtertext) && (!$filterfieldsarray) )
<?php
if ( (!$filtertext) && (!$filterfieldsarray) ) {
printf(gettext("Last %s firewall log entries."),count($filterlog));
else
echo sprintf(gettext('Showing %s matching log entries (maximum is %s).'), count($filterlog), $nentries);?>
} else {
echo sprintf(gettext('Showing %s matching log entries (maximum is %s).'), count($filterlog), $nentries);
}?>
</strong>
</td>
</tr>
<tr class="sortableHeaderRowIdentifier">
<td width="50" class="listhdrr"><?=gettext("Act");?></td>
<td class="listhdrr"><?=gettext("Time");?></td>
<td class="listhdrr"><?=gettext("If");?></td>
<tr>
<td width="50"><?=gettext("Act");?></td>
<td><?=gettext("Time");?></td>
<td><?=gettext("If");?></td>
<?php if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "1"):?>
<td width="10%" class="listhdrr"><?=gettext("Rule");?></td>
<td width="10%"><?=gettext("Rule");?></td>
<?php endif;?>
<td class="listhdrr"><?=gettext("Source");?></td>
<td class="listhdrr"><?=gettext("Destination");?></td>
<td class="listhdrr"><?=gettext("Proto");?></td>
<td><?=gettext("Source");?></td>
<td><?=gettext("Destination");?></td>
<td><?=gettext("Proto");?></td>
</tr>
<?php
if (isset($config['syslog']['filterdescriptions']))
<?php
if (isset($config['syslog']['filterdescriptions'])) {
buffer_rules_load();
}
$rowIndex = 0;
foreach ($filterlog as $filterent):
$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
$rowIndex++;?>
<tr class="<?=$evenRowClass?>">
<td class="listMRlr nowrap" align="center" sorttable_customkey="<?=$filterent['act']?>">
<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']) {
<td>
<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 'pass':
echo "play"; /* icon triangle */
break;
......@@ -740,18 +772,23 @@ include("head.inc");
default:
echo 'remove'; /* a x*/
break;
}
?>"></span></a></td>
<?php if (isset($filterent['count'])) echo $filterent['count'];?></a></center></td>
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['time']);?></td>
<td class="listMRr nowrap">
<?php if ($filterent['direction'] == "out"): ?>
}?>">
</span>
</a>
</td>
<td><?php echo htmlspecialchars($filterent['time']);?></td>
<td>
<?php
if ($filterent['direction'] == "out"): ?>
<span class="glyphicon glyphicon-cloud-download" alt="<?= gettext('Direction=OUT') ?>" title="<?= gettext('Direction=OUT') ?>"></span>
<?php endif; ?>
<?php echo htmlspecialchars($filterent['interface']);?></td>
<?php
if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "1")
<?php
endif; ?>
<?=htmlspecialchars($filterent['interface']);?>
</td>
<?php
if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "1") {
echo("<td class=\"listMRr nowrap\">".find_rule_by_number_buffer($filterent['rulenum'],$filterent['act'])."</td>");
}
$int = strtolower($filterent['interface']);
$proto = strtolower($filterent['proto']);
......@@ -762,60 +799,63 @@ include("head.inc");
} else {
$ipproto = "inet";
}
if (!isset($filterent['srcport'])) $filterent['srcport'] = null ;
if (!isset($filterent['srcport'])) {
$filterent['srcport'] = null ;
}
$srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto);
$src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']);
if (!isset($filterent['dstport'])) $filterent['dstport'] = null ;
if (!isset($filterent['dstport'])) {
$filterent['dstport'] = null ;
}
$dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto);
$dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']);
?>
<td class="listMRr nowrap">
?>
<td>
<span onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $src_htmlclass; ?>" alt="Icon Reverse Resolve with DNS"><span class="btn btn-default btn-xs glyphicon glyphicon-info-sign"></span></span>
<a title="<?=gettext("Easy Rule: Add to Block List");?>" href="#blockEasy" class="btn btn-danger btn-xs easy_block">
<input type="hidden" value="<?= $filterent['srcip']; ?>" id="srcip"/>
<input type="hidden" value="<?= $int;?>" id="intf"/>
<input type="hidden" value="<?= $ipproto;?>" id="ipproto"/>
<input type="hidden" value="<?= $filterent['srcip']; ?>" class="srcip"/>
<input type="hidden" value="<?= $int;?>" class="intf"/>
<input type="hidden" value="<?= $ipproto;?>" class="ipproto"/>
<span class="glyphicon glyphicon-remove" alt="Icon Easy Rule: Add to Block List"></span></a>
<?php echo $srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>';?>
</td>
<td class="listMRr nowrap">
<td>
<span onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $dst_htmlclass; ?>" alt="Icon Reverse Resolve with DNS"><span class="btn btn-default btn-xs glyphicon glyphicon-info-sign"></span></span>
<a title="<?=gettext("Easy Rule: Pass this traffic");?>" href="#blockEasy" class="btn btn-success btn-xs easy_pass">
<input type="hidden" value="<?= $filterent['srcip']; ?>" id="srcip"/>
<input type="hidden" value="<?= $filterent['dstip']; ?>" id="dstip"/>
<input type="hidden" value="<?= $filterent['dstport']; ?>" id="dstport"/>
<input type="hidden" value="<?= $int;?>" id="intf"/>
<input type="hidden" value="<?= $proto;?>" id="proto"/>
<input type="hidden" value="<?= $ipproto;?>" id="ipproto"/>
<input type="hidden" value="<?= $filterent['srcip']; ?>" class="srcip"/>
<input type="hidden" value="<?= $filterent['dstip']; ?>" class="dstip"/>
<input type="hidden" value="<?= $filterent['dstport']; ?>" class="dstport"/>
<input type="hidden" value="<?= $int;?>" class="intf"/>
<input type="hidden" value="<?= $proto;?>" class="proto"/>
<input type="hidden" value="<?= $ipproto;?>" class="ipproto"/>
<span class="glyphicon glyphicon-play" alt="<?= gettext('Icon Easy Rule: Pass this traffic') ?>"></span></a>
<?php echo $dststr . '<span class="RESOLVE-' . $dst_htmlclass . '"></span>';?>
</td>
<?php
if ($filterent['proto'] == "TCP")
<?php
if ($filterent['proto'] == "TCP") {
$filterent['proto'] .= ":{$filterent['tcpflags']}";
?>
<td class="listMRr nowrap"><?php echo htmlspecialchars($filterent['proto']);?></td>
}?>
<td>
<?php echo htmlspecialchars($filterent['proto']);?>
</td>
</tr>
<?php if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2"):?>
<?php
if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2"):?>
<tr class="<?=$evenRowClass?>">
<td colspan="2" class="listMRDescriptionL listMRlr" />
<td colspan="4" class="listMRDescriptionR listMRr nowrap"><?=find_rule_by_number_buffer($filterent['rulenum'],$filterent['act']);?></td>
<td colspan="2"></td>
<td colspan="4"><?=find_rule_by_number_buffer($filterent['rulenum'],$filterent['act']);?></td>
</tr>
<?php endif;
<?php
endif;
endforeach;
buffer_rules_clear(); ?>
</table>
</div>
</td>
</tr>
</table>
</div>
</section>
</div>
</div>
</section>
</div>
</section>
<!-- AJAXY STUFF -->
......@@ -830,9 +870,9 @@ $( document ).ready(function() {
dataType: 'json',
data: {
easyrule:'block',
srcip:$(this).find('#srcip').val(),
ipproto:$(this).find('#ipproto').val(),
intf:$(this).find('#intf').val()
srcip:$(this).find('.srcip').val(),
ipproto:$(this).find('.ipproto').val(),
intf:$(this).find('.intf').val()
},
complete: function(data,status) {
alert("<?= gettext('added block rule') ?>");
......@@ -849,12 +889,12 @@ $( document ).ready(function() {
dataType: 'json',
data: {
easyrule:'pass',
srcip:$(this).find('#srcip').val(),
dstip:$(this).find('#dstip').val(),
dstport:$(this).find('#dstport').val(),
proto:$(this).find('#proto').val(),
ipproto:$(this).find('#ipproto').val(),
intf:$(this).find('#intf').val()
srcip:$(this).find('.srcip').val(),
dstip:$(this).find('.dstip').val(),
dstport:$(this).find('.dstport').val(),
proto:$(this).find('.proto').val(),
ipproto:$(this).find('.ipproto').val(),
intf:$(this).find('.intf').val()
},
complete: function(data,status) {
alert("<?= gettext('added pass rule') ?>");
......
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