Project

General

Profile

« Previous | Next » 

Revision 473d0ff0

Added by Pierre POMES over 15 years ago

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.

View differences:

etc/inc/itemid.inc
64 64

  
65 65
}
66 66

  
67
/****f* itemid/get_id
68
 * NAME
69
 *   get_id - Get an item with ['id'] = $id from $array by reference
70
 * INPUTS
71
 *   $id       - int: The ID to get
72
 *   $array    - array to get the item from
73
 * RESULT
74
 *   mixed   - The item, NULL if not found
75
 ******/
76
function &get_id($id, &$array) {
77
	// Use $foo = &get_id('id', array('id'=>'value'));
78
	// Index to delete
79
	$get_index = NULL;
80

  
81
	// Search for the item in the array
82
	foreach ($array as $key => $item){
83
		// If this item is the one we want to delete
84
		if(isset($item['id']) && $item['id']==$id ){
85
			$get_index = $key;
86
			break;
87
		}
88
	}
89

  
90
	// If we found the item, unset it
91
	if( $get_index!==NULL)
92
		return $array[$get_index];
93
	else
94
		return false;
95
}
96

  
67 97
/****f* itemid/get_next_id
68 98
 * NAME
69 99
 *   get_next_id - find the next available id from an item list

Also available in: Unified diff