summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/easyrule.inc
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-04-11 00:03:35 -0700
committerNOYB <Al_Stu@Frontier.com>2016-04-11 00:03:35 -0700
commit9227260504fa3a07079bc8d4b968d85ff50b9895 (patch)
tree39d4113b6fd7a735a03402932e1e4a576623d7b7 /src/etc/inc/easyrule.inc
parent04e646ebd2f63ec03ece64dda5505ab374699b50 (diff)
downloadpfsense-9227260504fa3a07079bc8d4b968d85ff50b9895.zip
pfsense-9227260504fa3a07079bc8d4b968d85ff50b9895.tar.gz
Easyrule Block Firewall Separators Update
Update firewall rule separators positions when adding an easyrule block.
Diffstat (limited to 'src/etc/inc/easyrule.inc')
-rw-r--r--src/etc/inc/easyrule.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/etc/inc/easyrule.inc b/src/etc/inc/easyrule.inc
index 59e5d53..6304088 100644
--- a/src/etc/inc/easyrule.inc
+++ b/src/etc/inc/easyrule.inc
@@ -145,7 +145,18 @@ function easyrule_block_rule_create($int = 'wan', $ipproto = "inet") {
/* Do not translate this, it's considered a username which cannot contain international characters */
$filterent['created'] = make_config_revision_entry(null, "Easy Rule");
- array_splice($a_filter, 0, 0, array($filterent));
+ // Refer to firewall_rules_edit.php separators updating code.
+ // Using same code, variables, and techniques here.
+ $after = -1; // Place rule at top and move all separators.
+ array_splice($a_filter, $after+1, 0, array($filterent));
+
+ $tmpif = $int;
+
+ // Update the separators
+ $a_separators = &$config['filter']['separator'][strtolower($tmpif)];
+ $ridx = ifridx($tmpif, $after); // get rule index within interface
+ $mvnrows = +1;
+ move_separators($a_separators, $ridx, $mvnrows);
return true;
}
OpenPOWER on IntegriCloud