luci-proto-qmi: add APN and PIN validation
Signed-off-by: Nicholas Smith <nicholas@nbembedded.com> [squash commits, fix whitespace] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
6a8ad40b05
commit
114dc38dc2
1 changed files with 11 additions and 3 deletions
|
@ -65,8 +65,16 @@ return network.registerProtocol('qmi', {
|
||||||
}, this));
|
}, this));
|
||||||
};
|
};
|
||||||
|
|
||||||
s.taboption('general', form.Value, 'apn', _('APN'));
|
o = s.taboption('general', form.Value, 'apn', _('APN'));
|
||||||
s.taboption('general', form.Value, 'pincode', _('PIN'));
|
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 = s.taboption('general', form.ListValue, 'auth', _('Authentication Type'));
|
||||||
o.value('both', 'PAP/CHAP');
|
o.value('both', 'PAP/CHAP');
|
||||||
|
|
Loading…
Reference in a new issue