mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
Gateways: Single - as part of the migration strategy we moved most of the boilerplate in our master branch, this just has the side affect of storing default (unchanged) values in system_gateways_edit.php. This commit aims to prevent these entries from being stored to offer a smoother migration to MVC later.
This commit is contained in:
parent
4ae21be887
commit
dc94c78015
@ -35,6 +35,7 @@ $gateways = new \OPNsense\Routing\Gateways();
|
||||
$a_gateways = array_values($gateways->gatewaysIndexedByName(true, false, true));
|
||||
$dpinger_default = $gateways->getDpingerDefaults();
|
||||
|
||||
|
||||
// form processing
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$pconfig = $_POST;
|
||||
@ -334,6 +335,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
} elseif (isset($gateway['fargw'])) {
|
||||
unset($gateway['fargw']);
|
||||
}
|
||||
/* XXX: temporary solution to prevent default values being stored when unchanged */
|
||||
foreach ($dpinger_default as $key => $value) {
|
||||
if (isset($gateway[$key]) && $gateway[$key] == $value) {
|
||||
unset($gateway[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/* when saving the manual gateway we use the attribute which has the corresponding id */
|
||||
if (isset($realid)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user