diff options
author | pierrepomes <pierre.pomes@interface-tech.com> | 2009-12-12 15:57:19 -0500 |
---|---|---|
committer | pierrepomes <pierre.pomes@interface-tech.com> | 2009-12-12 15:57:19 -0500 |
commit | 473d0ff02fb2dddca7e98435614a0a47ba5e7115 (patch) | |
tree | c416bdc464af6baac8c698a412513f76b05238c7 /etc | |
parent | 1b6650903ac0770344012baee77c145b48d7b488 (diff) | |
download | pfsense-473d0ff02fb2dddca7e98435614a0a47ba5e7115.zip pfsense-473d0ff02fb2dddca7e98435614a0a47ba5e7115.tar.gz |
Add patch from lietu (Janne Enberg). Ticket #136
1) Multiple NAT rules can be assigned the same filter rule
-> Fixed, added assigned-nat-rule-id to filter rules to keep track of the assignment
2) when removing the link (i.e. switching to "pass" or "none", the linked rule isn't deleted (should it be? probably yes)
-> Fixed, when a NAT rule's association is removed, the filter rule is deleted. Added a "create new associated filter rule" option to the
dropdown if there is none selected.
3) The destination IP and port of linked rules can be edited in firewall_rules_edit.php and shouldn't be. Source should be editable but not
destination, since that should strictly be tied to the NAT rule.
-> Fixed, you cannot edit the destination for the filter rules that are linked to NAT rules, this has been disabled both by JavaScript and
PHP.
4) If you edit the source in a linked firewall rule, it gets overwritten when you edit the NAT rule. The NAT rule should never touch the
firewall rule source after the rule exists.
-> Fixed, previously the old rule was deleted and a new one created, now it only updates the old rule and doesn't touch the source.
Also added crosslinking from the NAT rule to the filter rule and back, so you can jump to edit the filter rule from the NAT rule and
vice-versa.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/itemid.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/etc/inc/itemid.inc b/etc/inc/itemid.inc index c4747f3..f8904df 100644 --- a/etc/inc/itemid.inc +++ b/etc/inc/itemid.inc @@ -64,6 +64,36 @@ function delete_id($id, &$array){ } +/****f* itemid/get_id + * NAME + * get_id - Get an item with ['id'] = $id from $array by reference + * INPUTS + * $id - int: The ID to get + * $array - array to get the item from + * RESULT + * mixed - The item, NULL if not found + ******/ +function &get_id($id, &$array) { + // Use $foo = &get_id('id', array('id'=>'value')); + // Index to delete + $get_index = NULL; + + // Search for the item in the array + foreach ($array as $key => $item){ + // If this item is the one we want to delete + if(isset($item['id']) && $item['id']==$id ){ + $get_index = $key; + break; + } + } + + // If we found the item, unset it + if( $get_index!==NULL) + return $array[$get_index]; + else + return false; +} + /****f* itemid/get_next_id * NAME * get_next_id - find the next available id from an item list |