summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_rules.php
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-04-12 22:43:33 +0700
committergnhb <gnoahb@gmail.com>2010-04-12 22:43:33 +0700
commiteca1f1ead81747afc1226610b4d2fe30e718706a (patch)
tree50c9b92565a624d5f7cb85bdc1ccd2d76057c577 /usr/local/www/firewall_rules.php
parentd32a40c1c6eb3d9de1f3ed2d958298aedfae16ea (diff)
parent00c827829ba1100be39dbd5508718903a07f11c8 (diff)
downloadpfsense-eca1f1ead81747afc1226610b4d2fe30e718706a.zip
pfsense-eca1f1ead81747afc1226610b4d2fe30e718706a.tar.gz
Merge branch 'master' of rcs.pfsense.org:pfsense/mainline
Diffstat (limited to 'usr/local/www/firewall_rules.php')
-rwxr-xr-xusr/local/www/firewall_rules.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index 24dfb2c..af0fedb 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -70,14 +70,17 @@ function check_for_advaned_options(&$item) {
return $item_set;
}
-function delete_nat_association(&$a_nat, $id) {
- if (!$id || !is_array($a_nat))
+function delete_nat_association($id) {
+ global $config;
+
+ if (!$id || !is_array($config['nat']['rule']))
return;
- for ($pos = 0; $pos < sizeof($a_nat); $pos++) {
- if ($a_nat[$pos]['associated-rule-id'] == $id)
- $a_nat[$pos]['associated-rule-id'] = '';
- }
+ $a_nat = &$config['nat']['rule'];
+
+ foreach ($a_nat as &$natent)
+ if ($natent['associated-rule-id'] == $id)
+ $natent['associated-rule-id'] = '';
}
if (!is_array($config['filter']['rule'])) {
@@ -147,8 +150,7 @@ if ($_POST) {
if ($_GET['act'] == "del") {
if ($a_filter[$_GET['id']]) {
if (!empty($a_filter[$_GET['id']]['associated-rule-id'])) {
- $a_nat = &$config['nat']['rule'];
- delete_nat_association($a_nat, $a_filter[$_GET['id']]['associated-rule-id']);
+ delete_nat_association($a_filter[$_GET['id']]['associated-rule-id']);
}
unset($a_filter[$_GET['id']]);
write_config();
@@ -161,9 +163,8 @@ if ($_GET['act'] == "del") {
if (isset($_POST['del_x'])) {
/* delete selected rules */
if (is_array($_POST['rule']) && count($_POST['rule'])) {
- $a_nat = &$config['nat']['rule'];
foreach ($_POST['rule'] as $rulei) {
- delete_nat_association($a_nat, $a_filter[$rulei]['associated-rule-id']);
+ delete_nat_association($a_filter[$rulei]['associated-rule-id']);
unset($a_filter[$rulei]);
}
write_config();
OpenPOWER on IntegriCloud