mirror of
https://github.com/openwrt/luci
synced 2025-01-09 04:28:37 +08:00
luci-proto-modemmanager: add APN and PIN validation
Signed-off-by: Nicholas Smith <nicholas@nbembedded.com> [squash commits, fix white space] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
98d1df8d24
commit
ebb676ef7b
@ -91,8 +91,16 @@ return network.registerProtocol('modemmanager', {
|
||||
}, this));
|
||||
};
|
||||
|
||||
s.taboption('general', form.Value, 'apn', _('APN'));
|
||||
s.taboption('general', form.Value, 'pincode', _('PIN'));
|
||||
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||
o.validate = function(section_id, value) {
|
||||
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
|
||||
return _('Invalid APN provided');
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
o = s.taboption('general', form.Value, 'pincode', _('PIN'));
|
||||
o.datatype = 'and(uinteger,minlength(4),maxlength(8))';
|
||||
|
||||
o = s.taboption('general', form.ListValue, 'auth', _('Authentication Type'));
|
||||
o.value('both', _('PAP/CHAP (both)'));
|
||||
|
Loading…
Reference in New Issue
Block a user