Changeset 4718 for lang/perl/Moxy

Show
Ignore:
Timestamp:
01/16/08 23:32:37 (5 years ago)
Author:
tokuhirom
Message:

lang/perl/Moxy: support posinfo(docomo iarea)

Location:
lang/perl/Moxy/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Moxy/trunk/config.yaml

    r3982 r4718  
    1010  server: 
    1111    module: HTTPProxy 
    12     port: 9999 
     12    port: 10000 
    1313    host: "localhost" 
    1414    max_clients: 80 
     
    3939  - module: FlashUseImgTag 
    4040  - module: DisableTableTag 
     41  - module: UserID 
    4142  - module: ShowHTTPHeaders 
    4243  - module: QRCode 
    43   - module: CookieCutter 
    4444 
    4545 
  • lang/perl/Moxy/trunk/lib/Moxy/Plugin/GPS.pm

    r4702 r4718  
    8787                } 
    8888 
    89                 my $output = $class->render_template( 
    90                     $context, 
    91                     'iarea.tt' => { 
    92                         errstr  => $errstr, 
    93                         queries => \%queries, 
    94                     } 
    95                 ); 
     89                my $redirect_to = $queries{nl} . "?"; 
     90                my $coordinates = "LAT=%2B35.39.55.197&LON=%2B139.43.54.653&GEO=wgs84&XACC=1"; 
     91                my $area = "AREACODE=06000"; 
     92                if (!$queries{posinfo}) { 
     93                    $redirect_to .= $area; 
     94                } elsif ($queries{posinfo} == 1) { 
     95                    $redirect_to .= "$area&$coordinates"; 
     96                } elsif ($queries{posinfo} == 2) { 
     97                    $redirect_to .= $coordinates; 
     98                } 
    9699 
    97                 my $response = HTTP::Response->new( 200, 'Moxy(GPS iarea)' ); 
    98                 $response->content($output); 
     100                my $response = HTTP::Response->new( 302, 'Redirect by Moxy(GPS willcom)' ); 
     101                $response->header(Location => $redirect_to); 
    99102                return $args->{filter}->proxy->response($response); 
    100103            }