From 723d97bbdfc82bda60007bd606ff39b2d39938f3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 3 Dec 2018 08:40:42 +0100 Subject: [PATCH] system: move settings as per #2279 Not the perfect spot either as this is for gateway groups now but still better than firewall and actually the original spot where the setting could be found. --- src/www/system_advanced_firewall.php | 54 ------------------------- src/www/system_general.php | 59 +++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/src/www/system_advanced_firewall.php b/src/www/system_advanced_firewall.php index 442c39890..d40ffcdc0 100644 --- a/src/www/system_advanced_firewall.php +++ b/src/www/system_advanced_firewall.php @@ -55,9 +55,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['kill_states'] = isset($config['system']['kill_states']); $pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']); - $pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']); - $pconfig['gw_switch_group4'] = isset($config['system']['gw_switch_group4']) ? $config['system']['gw_switch_group4'] : null; - $pconfig['gw_switch_group6'] = isset($config['system']['gw_switch_group6']) ? $config['system']['gw_switch_group6'] : null; $pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']); $pconfig['pf_share_forward'] = isset($config['system']['pf_share_forward']); $pconfig['pf_disable_force_gw'] = isset($config['system']['pf_disable_force_gw']); @@ -219,24 +216,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['skip_rules_gw_down']); } - if (!empty($pconfig['gw_switch_default'])) { - $config['system']['gw_switch_default'] = true; - } elseif (isset($config['system']['gw_switch_default'])) { - unset($config['system']['gw_switch_default']); - } - - if (!empty($pconfig['gw_switch_group4'])) { - $config['system']['gw_switch_group4'] = $pconfig['gw_switch_group4']; - } elseif (isset($config['system']['gw_switch_group4'])) { - unset($config['system']['gw_switch_group4']); - } - - if (!empty($pconfig['gw_switch_group6'])) { - $config['system']['gw_switch_group6'] = $pconfig['gw_switch_group6']; - } elseif (isset($config['system']['gw_switch_group6'])) { - unset($config['system']['gw_switch_group6']); - } - if (!empty($pconfig['ip_change_kill_states'])) { $config['system']['ip_change_kill_states'] = true; } elseif (isset($config['system']['ip_change_kill_states'])) { @@ -389,39 +368,6 @@ include("head.inc"); - - - - /> - - - - - - - - - - - - - - - -
diff --git a/src/www/system_general.php b/src/www/system_general.php index 8bcb8e91c..369f38e19 100644 --- a/src/www/system_general.php +++ b/src/www/system_general.php @@ -47,7 +47,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['language'] = $config['system']['language']; $pconfig['prefer_ipv4'] = isset($config['system']['prefer_ipv4']); $pconfig['theme'] = $config['theme']; - $pconfig['timezone'] = empty($config['system']['timezone']) ? 'Etc/UTC' : $config['system']['timezone'] ; + $pconfig['timezone'] = empty($config['system']['timezone']) ? 'Etc/UTC' : $config['system']['timezone']; + + $pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']); + $pconfig['gw_switch_group4'] = isset($config['system']['gw_switch_group4']) ? $config['system']['gw_switch_group4'] : null; + $pconfig['gw_switch_group6'] = isset($config['system']['gw_switch_group6']) ? $config['system']['gw_switch_group6'] : null; for ($dnscounter = 1; $dnscounter < 9; $dnscounter++) { $dnsname = "dns{$dnscounter}"; @@ -148,6 +152,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['dnslocalhost']); } + if (!empty($pconfig['gw_switch_default'])) { + $config['system']['gw_switch_default'] = true; + } elseif (isset($config['system']['gw_switch_default'])) { + unset($config['system']['gw_switch_default']); + } + + if (!empty($pconfig['gw_switch_group4'])) { + $config['system']['gw_switch_group4'] = $pconfig['gw_switch_group4']; + } elseif (isset($config['system']['gw_switch_group4'])) { + unset($config['system']['gw_switch_group4']); + } + + if (!empty($pconfig['gw_switch_group6'])) { + $config['system']['gw_switch_group6'] = $pconfig['gw_switch_group6']; + } elseif (isset($config['system']['gw_switch_group6'])) { + unset($config['system']['gw_switch_group6']); + } + $olddnsservers = $config['system']['dnsserver']; $config['system']['dnsserver'] = array(); @@ -155,7 +177,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { for ($dnscounter = 1; $dnscounter < 9; $dnscounter++) { $dnsname="dns{$dnscounter}"; $dnsgwname="dns{$dnscounter}gw"; - $olddnsgwname = !empty($config['system'][$dnsgwname]) ? $config['system'][$dnsgwname] : "none" ; + $olddnsgwname = !empty($config['system'][$dnsgwname]) ? $config['system'][$dnsgwname] : 'none'; if (!empty($pconfig[$dnsname])) { $config['system']['dnsserver'][] = $pconfig[$dnsname]; @@ -428,6 +450,39 @@ include("head.inc");
+ + + + /> + + + + + + + + + + + + + + + +