summaryrefslogtreecommitdiffstats
path: root/lib/network/connection/cellular_card.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-14 19:19:40 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-14 19:19:40 +0000
commit2f2e487aac9a63a137e91786e7b8f1b95fefc0a7 (patch)
tree11202031ad3f2841288b0183b9ed8059830b7c42 /lib/network/connection/cellular_card.pm
parenta6780433c4d961aaba52683c5d392bd56e327e2a (diff)
downloaddrakx-net-2f2e487aac9a63a137e91786e7b8f1b95fefc0a7.tar
drakx-net-2f2e487aac9a63a137e91786e7b8f1b95fefc0a7.tar.gz
drakx-net-2f2e487aac9a63a137e91786e7b8f1b95fefc0a7.tar.bz2
drakx-net-2f2e487aac9a63a137e91786e7b8f1b95fefc0a7.tar.xz
drakx-net-2f2e487aac9a63a137e91786e7b8f1b95fefc0a7.zip
check that PIN number is 4 digits
Diffstat (limited to 'lib/network/connection/cellular_card.pm')
-rw-r--r--lib/network/connection/cellular_card.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm
index eb0851e..fb6948f 100644
--- a/lib/network/connection/cellular_card.pm
+++ b/lib/network/connection/cellular_card.pm
@@ -68,6 +68,15 @@ sub get_hardware_settings {
[ { label => N("PIN number"), val => \$self->{hardware}{pin}, hidden => 1 } ];
}
+sub check_hardware_settings {
+ my ($self) = @_;
+ if ($self->{hardware}{pin} !~ /^[0-9]{4}$/) {
+ $self->{hardware}{error} = N("Wrong PIN number format: it should be 4 digits.");
+ return 0;
+ }
+ 1;
+}
+
sub get_peer_default_options {
my ($self) = @_;
$self->SUPER::get_peer_default_options,