- Timestamp:
- 03/03/08 15:25:26 (5 years ago)
- Location:
- lang/perl/HTTP-MobileAgent-Plugin-Locator/branches/get_locator_from_params
- Files:
-
- 1 added
- 1 modified
-
lib/HTTP/MobileAgent/Plugin/Locator.pm (modified) (2 diffs)
-
t/07_gps_parameter.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAgent-Plugin-Locator/branches/get_locator_from_params/lib/HTTP/MobileAgent/Plugin/Locator.pm
r7390 r7392 16 16 no strict 'refs'; 17 17 *{"HTTP\::MobileAgent\::gps_compliant"} = \&_gps_compliant; 18 *{"HTTP\::MobileAgent\::gps_parameter"} = \&_gps_parameter; 18 19 *{"HTTP\::MobileAgent\::locator"} = sub { $class->new( @_ ) }; 19 20 *{"HTTP\::MobileAgent\::get_location"} = sub { … … 32 33 } elsif ( $self->is_softbank ) { 33 34 return $self->is_type_3gc; 35 } 36 } 37 38 39 sub _gps_parameter { 40 my ( $self, $params ) = @_; 41 42 if ( $self->is_docomo ) { 43 return (!defined $params->{AREACODE}) ? 1 : 0; 44 } 45 elsif ( $self->is_ezweb ) { 46 return ( $params->{datum} =~ /^\d+$/ ) ? 1 : 0; 47 } 48 elsif ( $self->is_softbank ) { 49 return ( defined $params->{pos} ) ? 1 : 0; 50 } 51 elsif ( $self->is_airh_phone ) { 52 return 0; 53 } 54 else { 55 croak( "Invalid mobile user agent: " . $self->user_agent ); 34 56 } 35 57 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)