From bef388a70dffca0074d82cbd0f709c04c726248f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 14 Nov 2013 12:37:32 -0200 Subject: Show advanced outbound rules and inform user what are being used and what are being ignored. It should fix #2416 --- usr/local/www/firewall_nat_out.php | 119 ++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 9 deletions(-) (limited to 'usr') diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 85d6ddf..a35f21f 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -54,6 +54,11 @@ if (!is_array($config['nat']['outbound']['rule'])) $a_out = &$config['nat']['outbound']['rule']; +if (!isset($config['nat']['outbound']['mode'])) + $config['nat']['outbound']['mode'] = "automatic"; + +$mode = $config['nat']['outbound']['mode']; + if ($_POST['apply']) { write_config(); @@ -73,7 +78,7 @@ if ($_POST['apply']) { if (isset($_POST['save']) && $_POST['save'] == "Save") { /* mutually exclusive settings - if user wants advanced NAT, we don't generate automatic rules */ - if ($_POST['mode'] == "advanced" && $config['nat']['outbound']['mode'] != "advanced" && empty($a_out)) { + if ($_POST['mode'] == "advanced" && $mode != "advanced" && empty($a_out)) { /* * user has enabled advanced outbound NAT and doesn't have rules * lets automatically create entries @@ -327,7 +332,7 @@ if (is_subsystem_dirty('natconf')) - /> + /> @@ -336,7 +341,7 @@ if (is_subsystem_dirty('natconf')) - /> + /> @@ -355,7 +360,7 @@ if (is_subsystem_dirty('natconf')) - /> + /> @@ -364,7 +369,7 @@ if (is_subsystem_dirty('natconf')) - /> + /> @@ -418,17 +423,26 @@ if (is_subsystem_dirty('natconf')) "; $textse = ""; $iconfn .= "_d"; } else { $textss = $textse = ""; } + + if ($mode == "disabled" || $mode == "automatic"): +?> + " alt="icon" /> + + + " alt="icon" /> + + - - " alt="icon" /> - @@ -526,6 +540,93 @@ if (is_subsystem_dirty('natconf')) $i++; $nnats++; endforeach; + + if ($mode == "automatic" || $mode == "hybrid"): + global $FilterIflist; + if(empty($FilterIflist)) + filter_generate_optcfg_array(); + $automatic_rules = filter_nat_rules_outbound_automatic(implode(" ", filter_nat_rules_automatic_tonathosts())); + $i = 0; + foreach ($automatic_rules as $natent): +?> + +   + + " alt="icon" /> + + + +   + + + + + + + + + + + + + + +NO NAT'; + elseif (!$natent['target']) + echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])) . " address"; + elseif ($natent['target'] == "other-subnet") + echo $natent['targetip'] . '/' . $natent['targetip_subnet']; + else + echo $natent['target']; +?> + + + + + + + + +   + +   + + -- cgit v1.1