summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-11 12:06:17 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-11 12:06:17 +0545
commit37ba954df7f60273dbeb6be02c222b57507367de (patch)
tree010b33c5a9acc46b43ebd51e1976b0bd31b06f90 /usr/local/www/firewall_nat.php
parentd0c28e66a81bb06183b09514c6d1aa87e9c4deb0 (diff)
downloadpfsense-37ba954df7f60273dbeb6be02c222b57507367de.zip
pfsense-37ba954df7f60273dbeb6be02c222b57507367de.tar.gz
Code style Firewall NAT
Diffstat (limited to 'usr/local/www/firewall_nat.php')
-rw-r--r--usr/local/www/firewall_nat.php394
1 files changed, 206 insertions, 188 deletions
diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php
index adbb948..2fba0b7 100644
--- a/usr/local/www/firewall_nat.php
+++ b/usr/local/www/firewall_nat.php
@@ -48,14 +48,16 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("itemid.inc");
-if (!is_array($config['nat']['rule']))
+if (!is_array($config['nat']['rule'])) {
$config['nat']['rule'] = array();
+}
$a_nat = &$config['nat']['rule'];
/* if a custom message has been passed along, lets process it */
-if ($_GET['savemsg'])
+if ($_GET['savemsg']) {
$savemsg = $_GET['savemsg'];
+}
if ($_POST) {
@@ -89,8 +91,9 @@ if ($_GET['act'] == "del") {
if (write_config()) {
mark_subsystem_dirty('natconf');
- if ($want_dirty_filter)
+ if ($want_dirty_filter) {
mark_subsystem_dirty('filter');
+ }
}
header("Location: firewall_nat.php");
exit;
@@ -98,66 +101,73 @@ if ($_GET['act'] == "del") {
}
if (isset($_POST['del_x'])) {
- /* delete selected rules */
- if (is_array($_POST['rule']) && count($_POST['rule'])) {
- foreach ($_POST['rule'] as $rulei) {
+ /* delete selected rules */
+ if (is_array($_POST['rule']) && count($_POST['rule'])) {
+ foreach ($_POST['rule'] as $rulei) {
$target = $rule['target'];
// Check for filter rule associations
if (isset($a_nat[$rulei]['associated-rule-id'])){
delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
-
+
mark_subsystem_dirty('filter');
}
- unset($a_nat[$rulei]);
- }
- if (write_config())
+ unset($a_nat[$rulei]);
+ }
+ if (write_config()) {
mark_subsystem_dirty('natconf');
+ }
header("Location: firewall_nat.php");
exit;
}
} else {
- /* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
- unset($movebtn);
- foreach ($_POST as $pn => $pd) {
- if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
- $movebtn = $matches[1];
- break;
- }
- }
- /* move selected rules before this rule */
- if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
- $a_nat_new = array();
-
- /* copy all rules < $movebtn and not selected */
- for ($i = 0; $i < $movebtn; $i++) {
- if (!in_array($i, $_POST['rule']))
- $a_nat_new[] = $a_nat[$i];
- }
-
- /* copy all selected rules */
- for ($i = 0; $i < count($a_nat); $i++) {
- if ($i == $movebtn)
- continue;
- if (in_array($i, $_POST['rule']))
- $a_nat_new[] = $a_nat[$i];
- }
-
- /* copy $movebtn rule */
- if ($movebtn < count($a_nat))
- $a_nat_new[] = $a_nat[$movebtn];
-
- /* copy all rules > $movebtn and not selected */
- for ($i = $movebtn+1; $i < count($a_nat); $i++) {
- if (!in_array($i, $_POST['rule']))
- $a_nat_new[] = $a_nat[$i];
- }
- $a_nat = $a_nat_new;
- if (write_config())
- mark_subsystem_dirty('natconf');
- header("Location: firewall_nat.php");
- exit;
- }
+ /* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
+ unset($movebtn);
+ foreach ($_POST as $pn => $pd) {
+ if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
+ $movebtn = $matches[1];
+ break;
+ }
+ }
+ /* move selected rules before this rule */
+ if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
+ $a_nat_new = array();
+
+ /* copy all rules < $movebtn and not selected */
+ for ($i = 0; $i < $movebtn; $i++) {
+ if (!in_array($i, $_POST['rule'])) {
+ $a_nat_new[] = $a_nat[$i];
+ }
+ }
+
+ /* copy all selected rules */
+ for ($i = 0; $i < count($a_nat); $i++) {
+ if ($i == $movebtn) {
+ continue;
+ }
+ if (in_array($i, $_POST['rule'])) {
+ $a_nat_new[] = $a_nat[$i];
+ }
+ }
+
+ /* copy $movebtn rule */
+ if ($movebtn < count($a_nat)) {
+ $a_nat_new[] = $a_nat[$movebtn];
+ }
+
+ /* copy all rules > $movebtn and not selected */
+ for ($i = $movebtn+1; $i < count($a_nat); $i++) {
+ if (!in_array($i, $_POST['rule'])) {
+ $a_nat_new[] = $a_nat[$i];
+ }
+ }
+ $a_nat = $a_nat_new;
+ if (write_config()) {
+ mark_subsystem_dirty('natconf');
+ }
+ header("Location: firewall_nat.php");
+ exit;
+ }
}
$closehead = false;
@@ -181,7 +191,7 @@ echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></
<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="firewall nat">
- <tr><td>
+ <tr><td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php");
@@ -190,41 +200,42 @@ echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></
$tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php");
display_top_tabs($tab_array);
?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
- <tr id="frheader">
- <td width="3%" class="list">&nbsp;</td>
- <td width="3%" class="list">&nbsp;</td>
- <td width="5%" class="listhdrr"><?=gettext("If");?></td>
- <td width="5%" class="listhdrr"><?=gettext("Proto");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("Src. addr");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("Src. ports");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("Dest. addr");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("Dest. ports");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("NAT IP");?></td>
- <td width="11%" class="listhdrr nowrap"><?=gettext("NAT Ports");?></td>
- <td width="11%" class="listhdr"><?=gettext("Description");?></td>
- <td width="5%" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="list">
- <tr>
- <td width="17">
- <?php if (count($a_nat) == 0): ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
- <?php else: ?>
- <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
- <?php endif; ?>
- </td>
- <td><a href="firewall_nat_edit.php?after=-1"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $nnats = $i = 0; foreach ($a_nat as $natent): ?>
- <?php
-
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+ <tr id="frheader">
+ <td width="3%" class="list">&nbsp;</td>
+ <td width="3%" class="list">&nbsp;</td>
+ <td width="5%" class="listhdrr"><?=gettext("If");?></td>
+ <td width="5%" class="listhdrr"><?=gettext("Proto");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("Src. addr");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("Src. ports");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("Dest. addr");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("Dest. ports");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("NAT IP");?></td>
+ <td width="11%" class="listhdrr nowrap"><?=gettext("NAT Ports");?></td>
+ <td width="11%" class="listhdr"><?=gettext("Description");?></td>
+ <td width="5%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="list">
+ <tr>
+ <td width="17">
+ <?php if (count($a_nat) == 0): ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
+ <?php else: ?>
+ <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
+ <?php endif; ?>
+ </td>
+ <td><a href="firewall_nat_edit.php?after=-1"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php
+ $nnats = $i = 0;
+ foreach ($a_nat as $natent):
+
//build Alias popup box
$span_end = "</U></span>";
@@ -248,59 +259,62 @@ echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></
$alias_target_span_end = $alias_popup["dst_end"];
$alias_local_port_span_end = $alias_popup["dstport_end"];
- if (isset($natent['disabled']))
+ if (isset($natent['disabled'])) {
$textss = "<span class=\"gray\">";
- else
+ } else {
$textss = "<span>";
+ }
$textse = "</span>";
-
+
/* if user does not have access to edit an interface skip on to the next record */
- if(!have_natpfruleint_access($natent['interface']))
+ if (!have_natpfruleint_access($natent['interface'])) {
continue;
+ }
?>
- <tr valign="top" id="fr<?=$nnats;?>">
- <td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;" /></td>
- <td class="listt" align="center">
- <?php if($natent['associated-rule-id'] == "pass"): ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=gettext("All traffic matching this NAT entry is passed"); ?>" border="0" alt="pass" />
+ <tr valign="top" id="fr<?=$nnats;?>">
+ <td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;" /></td>
+ <td class="listt" align="center">
+ <?php if ($natent['associated-rule-id'] == "pass"): ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=gettext("All traffic matching this NAT entry is passed"); ?>" border="0" alt="pass" />
<?php elseif (!empty($natent['associated-rule-id'])): ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="17" height="17" title="<?=gettext("Firewall rule ID"); ?> <?=htmlspecialchars($nnatid); ?> <?=gettext("is managed with this rule"); ?>" border="0" alt="change" />
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="17" height="17" title="<?=gettext("Firewall rule ID"); ?> <?=htmlspecialchars($nnatid); ?> <?=gettext("is managed with this rule"); ?>" border="0" alt="change" />
<?php endif; ?>
- </td>
- <td class="listlr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?>
- <?php
- if (!$natent['interface'])
- echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
- else
- echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
- ?>
- <?=$textse;?>
- </td>
-
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?=strtoupper($natent['protocol']);?><?=$textse;?>
- </td>
-
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?>
- </td>
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['source']['port']));?><?php echo $alias_src_port_span_end;?><?=$textse;?>
- </td>
-
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['destination']));?><?php echo $alias_dst_span_end;?><?=$textse;?>
- </td>
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['destination']['port']));?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
- </td>
-
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?php echo $alias_target_span_begin;?><?php echo htmlspecialchars($natent['target']);?><?php echo $alias_target_span_end;?><?=$textse;?>
- </td>
- <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ </td>
+ <td class="listlr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?>
+ <?php
+ if (!$natent['interface']) {
+ echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
+ } else {
+ echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
+ }
+ ?>
+ <?=$textse;?>
+ </td>
+
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?=strtoupper($natent['protocol']);?><?=$textse;?>
+ </td>
+
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?>
+ </td>
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['source']['port']));?><?php echo $alias_src_port_span_end;?><?=$textse;?>
+ </td>
+
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['destination']));?><?php echo $alias_dst_span_end;?><?=$textse;?>
+ </td>
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['destination']['port']));?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
+ </td>
+
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?php echo $alias_target_span_begin;?><?php echo htmlspecialchars($natent['target']);?><?php echo $alias_target_span_end;?><?=$textse;?>
+ </td>
+ <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
<?php
$localport = $natent['local-port'];
@@ -311,67 +325,71 @@ echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></
$localport .= '-' . $localendport;
}
?>
- <?=$textss;?><?php echo $alias_local_port_span_begin;?><?php echo htmlspecialchars(pprint_port($localport));?><?php echo $alias_local_port_span_end;?><?=$textse;?>
- </td>
-
- <td class="listbg" onclick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
- <?=$textss;?><?=htmlspecialchars($natent['descr']);?>&nbsp;<?=$textse;?>
- </td>
- <td valign="middle" class="list nowrap">
- <table border="0" cellspacing="0" cellpadding="1" summary="move">
- <tr>
- <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="<?=gettext("move selected rules before this rule");?>" height="17" type="image" width="17" border="0" /></td>
- <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td>
- </tr>
- <tr>
- <td align="center" valign="middle"><a href="firewall_nat.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?>" alt="delete" /></a></td>
- <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new NAT based on this one");?>" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; $nnats++; endforeach; ?>
- <tr>
- <td class="list" colspan="8"></td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td class="list nowrap" valign="middle">
- <table border="0" cellspacing="0" cellpadding="1" summary="move">
- <tr>
- <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules to end"); ?>" border="0" alt="move" /><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" style="width:17;height:17;border:0" title="<?=gettext("move selected rules to end");?>" /><?php endif; ?></td>
- </tr>
- <tr>
- <td width="17">
- <?php if (count($a_nat) == 0): ?>
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
- <?php else: ?>
- <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
- <?php endif; ?>
- </td>
- <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr><td>&nbsp;</td></tr>
- <tr>
- <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11" alt="pass" /></td>
- <td colspan="3"><?=gettext("pass"); ?></td>
- </tr>
- <tr>
- <td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11" alt="chain" /></td>
- <td colspan="3"><?=gettext("linked rule");?></td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
+ <?=$textss;?><?php echo $alias_local_port_span_begin;?><?php echo htmlspecialchars(pprint_port($localport));?><?php echo $alias_local_port_span_end;?><?=$textse;?>
+ </td>
+
+ <td class="listbg" onclick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
+ <?=$textss;?><?=htmlspecialchars($natent['descr']);?>&nbsp;<?=$textse;?>
+ </td>
+ <td valign="middle" class="list nowrap">
+ <table border="0" cellspacing="0" cellpadding="1" summary="move">
+ <tr>
+ <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="<?=gettext("move selected rules before this rule");?>" height="17" type="image" width="17" border="0" /></td>
+ <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="middle"><a href="firewall_nat.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?>" alt="delete" /></a></td>
+ <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new NAT based on this one");?>" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php
+ $i++;
+ $nnats++;
+ endforeach;
+ ?>
+ <tr>
+ <td class="list" colspan="8"></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td class="list nowrap" valign="middle">
+ <table border="0" cellspacing="0" cellpadding="1" summary="move">
+ <tr>
+ <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules to end"); ?>" border="0" alt="move" /><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" style="width:17;height:17;border:0" title="<?=gettext("move selected rules to end");?>" /><?php endif; ?></td>
+ </tr>
+ <tr>
+ <td width="17">
+ <?php if (count($a_nat) == 0): ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
+ <?php else: ?>
+ <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
+ <?php endif; ?>
+ </td>
+ <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td>&nbsp;</td></tr>
+ <tr>
+ <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11" alt="pass" /></td>
+ <td colspan="3"><?=gettext("pass"); ?></td>
+ </tr>
+ <tr>
+ <td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11" alt="chain" /></td>
+ <td colspan="3"><?=gettext("linked rule");?></td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
<?php
if ($pkg['tabs'] <> "") {
- echo "</td></tr></table>";
+ echo "</td></tr></table>";
}
?>
OpenPOWER on IntegriCloud