Project

General

Profile

« Previous | Next » 

Revision 77b6d849

Added by Renato Botelho over 8 years ago

Fix #6472: Enable/Disable associated firewall rule when NAT rule changes

View differences:

src/usr/local/www/firewall_nat.php
193 193
	if ($a_nat[$_GET['id']]) {
194 194
		if (isset($a_nat[$_GET['id']]['disabled'])) {
195 195
			unset($a_nat[$_GET['id']]['disabled']);
196
			$rule_status = true;
196 197
		} else {
197 198
			$a_nat[$_GET['id']]['disabled'] = true;
199
			$rule_status = false;
198 200
		}
201

  
202
		// Check for filter rule associations
203
		if (isset($a_nat[$_GET['id']]['associated-rule-id'])) {
204
			toggle_id($a_nat[$_GET['id']]['associated-rule-id'],
205
			    $config['filter']['rule'], $rule_status);
206
			unset($rule_status);
207
			mark_subsystem_dirty('filter');
208
		}
209

  
199 210
		if (write_config(gettext("Firewall: NAT: Port forward, enable/disable NAT rule"))) {
200 211
			mark_subsystem_dirty('natconf');
201 212
		}
src/usr/local/www/firewall_nat_edit.php
528 528

  
529 529
		// Update the NAT entry now
530 530
		if (isset($id) && $a_nat[$id]) {
531

  
532
			if (isset($natent['associated-rule-id']) &&
533
			    (isset($a_nat[$id]['disabled']) !== isset($natent['disabled']))) {
534
				// Check for filter rule associations
535
				toggle_id($natent['associated-rule-id'],
536
				    $config['filter']['rule'],
537
				    !isset($natent['disabled']));
538
				mark_subsystem_dirty('filter');
539
			}
531 540
			$a_nat[$id] = $natent;
532 541
		} else {
533 542
			$natent['created'] = make_config_revision_entry();

Also available in: Unified diff