diff options
author | Renato Botelho <renato@netgate.com> | 2016-01-19 16:26:47 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-01-19 16:26:47 -0200 |
commit | 8f385535518be48a1ba62f4123ec06ee9b11d776 (patch) | |
tree | 07683a53628777f86a1a2218f5a89096611b792a /src | |
parent | 107b637d53be7863f75fa2e790e2b2f235dc6729 (diff) | |
parent | cd5675459ffb2a35019dae11391dd0d0ea709863 (diff) | |
download | pfsense-8f385535518be48a1ba62f4123ec06ee9b11d776.zip pfsense-8f385535518be48a1ba62f4123ec06ee9b11d776.tar.gz |
Merge pull request #2480 from phil-davis/gt8
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/firewall_nat.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index 0d0d3a6..287133b 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -164,6 +164,19 @@ if (isset($_POST['del_x'])) { header("Location: firewall_nat.php"); exit; } +} else if ($_GET['act'] == "toggle") { + if ($a_nat[$_GET['id']]) { + if (isset($a_nat[$_GET['id']]['disabled'])) { + unset($a_nat[$_GET['id']]['disabled']); + } else { + $a_nat[$_GET['id']]['disabled'] = true; + } + if (write_config(gettext("Firewall: NAT: Port forward, enable/disable NAT rule"))) { + mark_subsystem_dirty('natconf'); + } + header("Location: firewall_nat.php"); + exit; + } } $pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward")); @@ -194,6 +207,7 @@ display_top_tabs($tab_array); <thead> <tr> <th><!-- Checkbox --></th> + <th><!-- Icon --></th> <th><!-- Rule type --></th> <th><?=gettext("Interface")?></th> <th><?=gettext("Protocol")?></th> @@ -225,13 +239,26 @@ foreach ($a_nat as $natent): if (!have_natpfruleint_access($natent['interface'])) { continue; } + + if (isset($natent['disabled'])) { + $iconfn = "pass_d"; + $trclass = 'class="disabled"'; + } else { + $iconfn = "pass"; + $trclass = ''; + } ?> - <tr id="fr<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';"> + <tr id="fr<?=$nnats;?>" <?=$trclass?> onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';"> <td > <input type="checkbox" id="frc<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" name="rule[]" value="<?=$i;?>"/> </td> <td> + <a href="?act=toggle&id=<?=$i?>"> + <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i> + </a> + </td> + <td> <?php if ($natent['associated-rule-id'] == "pass"): ?> |