From e38b8457257e7d07a3c6d1260880faedbc10cb18 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 29 Dec 2017 13:02:15 +0000 Subject: [PATCH] firewall: prune help text trivia and make "pure nat" a checkbox --- src/www/system_advanced_firewall.php | 43 ++++++++-------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/src/www/system_advanced_firewall.php b/src/www/system_advanced_firewall.php index 2b3455d69..0d2e2c88d 100644 --- a/src/www/system_advanced_firewall.php +++ b/src/www/system_advanced_firewall.php @@ -63,11 +63,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['pf_share_forward'] = isset($config['system']['pf_share_forward']); $pconfig['pf_disable_force_gw'] = isset($config['system']['pf_disable_force_gw']); $pconfig['srctrack'] = !empty($config['system']['srctrack']) ? $config['system']['srctrack'] : null; - if (!isset($config['system']['disablenatreflection'])) { - $pconfig['natreflection'] = "purenat"; - } else { - $pconfig['natreflection'] = "disable"; - } + $pconfig['natreflection'] = empty($config['system']['disablenatreflection']); $pconfig['enablebinatreflection'] = !empty($config['system']['enablebinatreflection']); $pconfig['enablenatreflectionhelper'] = isset($config['system']['enablenatreflectionhelper']) ? $config['system']['enablenatreflectionhelper'] : null; $pconfig['snat_use_sticky'] = !empty($config['system']['snat_use_sticky']); @@ -158,12 +154,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['checkaliasesurlcert']); } - if ($pconfig['natreflection'] == "purenat") { - if (isset($config['system']['disablenatreflection'])) { - unset($config['system']['disablenatreflection']); - } - } else { - $config['system']['disablenatreflection'] = "yes"; + /* setting is inverted on the page */ + if (empty($pconfig['natreflection'])) { + $config['system']['disablenatreflection'] = 'yes'; + } elseif (isset($config['system']['disablenatreflection'])) { + unset($config['system']['disablenatreflection']); } if (!empty($pconfig['enablebinatreflection'])) { @@ -171,6 +166,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } elseif (isset($config['system']['enablebinatreflection'])) { unset($config['system']['enablebinatreflection']); } + $config['system']['snat_use_sticky'] = !empty($pconfig['snat_use_sticky']); if (!empty($pconfig['disablereplyto'])) { @@ -283,19 +279,9 @@ include("head.inc"); - + /> @@ -305,9 +291,7 @@ include("head.inc"); /> @@ -317,10 +301,7 @@ include("head.inc"); /> @@ -329,7 +310,7 @@ include("head.inc"); />