diff options
author | Phil Davis <phil.davis@inf.org> | 2015-05-11 12:06:17 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-05-11 12:06:17 +0545 |
commit | 37ba954df7f60273dbeb6be02c222b57507367de (patch) | |
tree | 010b33c5a9acc46b43ebd51e1976b0bd31b06f90 /usr/local/www/firewall_nat_npt.php | |
parent | d0c28e66a81bb06183b09514c6d1aa87e9c4deb0 (diff) | |
download | pfsense-37ba954df7f60273dbeb6be02c222b57507367de.zip pfsense-37ba954df7f60273dbeb6be02c222b57507367de.tar.gz |
Code style Firewall NAT
Diffstat (limited to 'usr/local/www/firewall_nat_npt.php')
-rw-r--r-- | usr/local/www/firewall_nat_npt.php | 175 |
1 files changed, 92 insertions, 83 deletions
diff --git a/usr/local/www/firewall_nat_npt.php b/usr/local/www/firewall_nat_npt.php index 2a9d2fe..3fcfbf4 100644 --- a/usr/local/www/firewall_nat_npt.php +++ b/usr/local/www/firewall_nat_npt.php @@ -71,8 +71,9 @@ if ($_POST) { if ($_GET['act'] == "del") { if ($a_npt[$_GET['id']]) { unset($a_npt[$_GET['id']]); - if (write_config()) + if (write_config()) { mark_subsystem_dirty('natconf'); + } header("Location: firewall_nat_npt.php"); exit; } @@ -89,7 +90,8 @@ include("head.inc"); <?php if (is_subsystem_dirty('natconf')): ?> <?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 npt"> <tr><td> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="firewall nat npt"> + <tr><td> <?php $tab_array = array(); $tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php"); @@ -98,87 +100,94 @@ include("head.inc"); $tab_array[] = array(gettext("NPt"), true, "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> - <td width="10%" class="listhdrr"><?=gettext("Interface"); ?></td> - <td width="20%" class="listhdrr"><?=gettext("External Prefix"); ?></td> - <td width="15%" class="listhdrr"><?=gettext("Internal prefix"); ?></td> - <td width="30%" class="listhdr"><?=gettext("Description"); ?></td> - <td width="10%" class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td width="17"></td> - <td valign="middle"><a href="firewall_nat_npt_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>" alt="add" /></a></td> - </tr> - </table> - </td> - </tr> - <?php - $textse = "</span>"; - - $i = 0; foreach ($a_npt as $natent): - - if (isset($natent['disabled'])) - $textss = "<span class=\"gray\">"; - else - $textss = "<span>"; ?> - <tr> - <td class="listlr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> - <?php - echo $textss; - if (!$natent['interface']) - echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan")); - else - echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])); - echo $textse; - ?> - </td> - <?php - $source_net = pprint_address($natent['source']); - $source_cidr = strstr($source_net, '/'); - $destination_net = pprint_address($natent['destination']); - $destination_cidr = strstr($destination_net, '/'); - ?> - <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> - <?php echo $textss . $destination_net . $textse; ?> - </td> - <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> - <?php echo $textss . $source_net . $textse; ?> - </td> - <td class="listbg" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> - <?=$textss;?> - <?=htmlspecialchars($natent['descr']);?> - <?=$textse;?> - </td> - <td class="list nowrap"> - <table border="0" cellspacing="0" cellpadding="1" summary="edit"> - <tr> - <td valign="middle"><a href="firewall_nat_npt_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>" alt="edit" /></a></td> - <td valign="middle"><a href="firewall_nat_npt.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>" alt="delete" /></a></td> - </tr> - </table> - </td> - </tr> - <?php $i++; endforeach; ?> - <tr> - <td class="list" colspan="4"></td> - <td class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td width="17"></td> - <td valign="middle"><a href="firewall_nat_npt_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>" alt="add" /></a></td> - </tr> - </table> - </td> - </tr> - </table> - </div> - </td> -</tr> + </td></tr> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> + <tr> + <td width="10%" class="listhdrr"><?=gettext("Interface"); ?></td> + <td width="20%" class="listhdrr"><?=gettext("External Prefix"); ?></td> + <td width="15%" class="listhdrr"><?=gettext("Internal prefix"); ?></td> + <td width="30%" class="listhdr"><?=gettext("Description"); ?></td> + <td width="10%" class="list"> + <table border="0" cellspacing="0" cellpadding="1" summary="add"> + <tr> + <td width="17"></td> + <td valign="middle"><a href="firewall_nat_npt_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>" alt="add" /></a></td> + </tr> + </table> + </td> + </tr> +<?php + $textse = "</span>"; + + $i = 0; + foreach ($a_npt as $natent): + + if (isset($natent['disabled'])) { + $textss = "<span class=\"gray\">"; + } else { + $textss = "<span>"; + } +?> + <tr> + <td class="listlr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> +<?php + echo $textss; + if (!$natent['interface']) { + echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan")); + } else { + echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])); + } + echo $textse; +?> + </td> +<?php + $source_net = pprint_address($natent['source']); + $source_cidr = strstr($source_net, '/'); + $destination_net = pprint_address($natent['destination']); + $destination_cidr = strstr($destination_net, '/'); +?> + <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> + <?php echo $textss . $destination_net . $textse; ?> + </td> + <td class="listr" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> + <?php echo $textss . $source_net . $textse; ?> + </td> + <td class="listbg" ondblclick="document.location='firewall_nat_npt_edit.php?id=<?=$i;?>';"> + <?=$textss;?> + <?=htmlspecialchars($natent['descr']);?> + <?=$textse;?> + </td> + <td class="list nowrap"> + <table border="0" cellspacing="0" cellpadding="1" summary="edit"> + <tr> + <td valign="middle"><a href="firewall_nat_npt_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>" alt="edit" /></a></td> + <td valign="middle"><a href="firewall_nat_npt.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>" alt="delete" /></a></td> + </tr> + </table> + </td> + </tr> +<?php + $i++; + endforeach; +?> + <tr> + <td class="list" colspan="4"></td> + <td class="list"> + <table border="0" cellspacing="0" cellpadding="1" summary="add"> + <tr> + <td width="17"></td> + <td valign="middle"><a href="firewall_nat_npt_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>" alt="add" /></a></td> + </tr> + </table> + </td> + </tr> + </table> + </div> + </td> + </tr> </table> </form> <?php include("fend.inc"); ?> |