From 8e2a409171011bfc14149c5fa533d938f49eebba Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 5 Aug 2014 10:01:37 -0300 Subject: [PATCH] Use GPS type presets only to pre-set values then user can change it. After user changes, save type always as Custom to avoid overwriting values when user attempt to edit. It fixes #3782 --- usr/local/www/services_ntpd_gps.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/local/www/services_ntpd_gps.php b/usr/local/www/services_ntpd_gps.php index 7586b62090..84cee47926 100644 --- a/usr/local/www/services_ntpd_gps.php +++ b/usr/local/www/services_ntpd_gps.php @@ -70,7 +70,7 @@ if ($_POST) { else unset($config['ntpd']['gps']); if (!empty($_POST['gpstype'])) - $config['ntpd']['gps']['type'] = $_POST['gpstype']; + $config['ntpd']['gps']['type'] = 'Custom'; elseif (isset($config['ntpd']['gps']['type'])) unset($config['ntpd']['gps']['type']); @@ -314,8 +314,9 @@ SureGPS = #Sure Electronics SKG16B gpsdef['fudge2'] = "0.407"; gpsdef['inittxt'] = "JFBNVEsyMjUsMCoyQg0KJFBNVEszMTQsMSwxLDAsMSwwLDUsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDEsMCoyRA0KJFBNVEszMDEsMioyRQ0KJFBNVEszOTcsMCoyMw0KJFBNVEsxMDIqMzENCiRQTVRLMzEzLDEqMkUNCiRQTVRLNTEzLDEqMjgNCiRQTVRLMzE5LDAqMjUNCiRQTVRLNTI3LDAuMDAqMDANCiRQTVRLMjUxLDk2MDAqMTcNCg=="; break; - - } + default: + return; + } //then update the html and set the common stuff document.getElementById("gpsnmea").selectedIndex = gpsdef['nmea']; @@ -386,6 +387,7 @@ SureGPS = #Sure Electronics SKG16B