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");
-
- =gettext('Gateway switching') ?>
-
- />
- =gettext("Allow default gateway switching"); ?>
-
- = gettext('If the link where the default gateway resides fails switch the default gateway to another available one.') ?>
- = gettext('When using default gateway switching use any available gateway or select a specific gateway group.') ?>
-
-
-
-
- =gettext('IPv4 Gateway Group') ?>
-
-
- >= gettext('Any available gateway') ?>
-
- >= $gwgroup['name'] ?>
-
-
-
-
-
- =gettext('IPv6 Gateway Group') ?>
-
-
- >= gettext('Any available gateway') ?>
-
- >= $gwgroup['name'] ?>
-
-
-
-
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");
+
+ =gettext('Gateway switching') ?>
+
+ />
+ =gettext("Allow default gateway switching"); ?>
+
+ = gettext('If the link where the default gateway resides fails switch the default gateway to another available one.') ?>
+ = gettext('When using default gateway switching use any available gateway or select a specific gateway group below.') ?>
+
+
+
+
+ =gettext('IPv4 gateway group') ?>
+
+
+ >= gettext('Any available gateway') ?>
+
+ >= $gwgroup['name'] ?>
+
+
+
+
+
+ =gettext('IPv6 gateway group') ?>
+
+
+ >= gettext('Any available gateway') ?>
+
+ >= $gwgroup['name'] ?>
+
+
+
+