From b23eaa9ee3e594b11fd906c5fa53c135e16a4670 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Wed, 25 Mar 2009 18:34:52 +0000 Subject: Added support for 3G connections which do not require PIN number (#48837). --- lib/network/connection/cellular_card.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/network/connection') diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm index e2753d6..d20540c 100644 --- a/lib/network/connection/cellular_card.pm +++ b/lib/network/connection/cellular_card.pm @@ -107,12 +107,12 @@ sub get_networks { sub get_hardware_settings { my ($self) = @_; - [ { label => N("PIN number (4 digits)"), val => \$self->{hardware}{pin}, hidden => 1 } ]; + [ { label => N("PIN number (4 digits). Leave empty if PIN is not required."), val => \$self->{hardware}{pin}, hidden => 1 } ]; } sub check_hardware_settings { my ($self) = @_; - if ($self->{hardware}{pin} !~ /^[0-9]{4}$/) { + if ($self->{hardware}{pin} !~ /(^$|^[0-9]{4}$)/) { $self->{hardware}{error} = translate($wrong_pin_error); return 0; } @@ -192,7 +192,11 @@ sub check_device { sub check_hardware { my ($self) = @_; - to_bool(run_program::rooted($::prefix, 'comgt', '>', '/dev/null', '-d', $self->get_control_device, 'PIN')); + if ($self->{hardware}{pin}) { + to_bool(run_program::rooted($::prefix, 'comgt', '>', '/dev/null', '-d', $self->get_control_device, 'PIN')); + } else { + to_bool(run_program::rooted($::prefix, 'comgt', '>', '/dev/null', '-d', $self->get_control_device)); + } } sub configure_hardware { -- cgit v1.2.1