protocols: make APN option optional again
Fixes: #5284 Fixes:1661ac6bf8
("luci-proto-ncm: add APN and PIN validation") Fixes:114dc38dc2
("luci-proto-qmi: add APN and PIN validation") Fixes:6a8ad40b05
("luci-proto-3g: add APN and PIN validation") Fixes:ebb676ef7b
("luci-proto-modemmanager: add APN and PIN validation") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
730ec8f29f
commit
5ff3ef7cbb
4 changed files with 12 additions and 0 deletions
|
@ -94,6 +94,9 @@ return network.registerProtocol('3g', {
|
||||||
|
|
||||||
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (value == null || value == '')
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
||||||
return _('Invalid APN provided');
|
return _('Invalid APN provided');
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,9 @@ return network.registerProtocol('modemmanager', {
|
||||||
|
|
||||||
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (value == null || value == '')
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
||||||
return _('Invalid APN provided');
|
return _('Invalid APN provided');
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,9 @@ return network.registerProtocol('ncm', {
|
||||||
|
|
||||||
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (value == null || value == '')
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
||||||
return _('Invalid APN provided');
|
return _('Invalid APN provided');
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ return network.registerProtocol('qmi', {
|
||||||
|
|
||||||
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (value == null || value == '')
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
||||||
return _('Invalid APN provided');
|
return _('Invalid APN provided');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue