2019-03-21 21:12:45 +00:00
|
|
|
package Travelynx::Controller::Api;
|
|
|
|
use Mojo::Base 'Mojolicious::Controller';
|
|
|
|
|
2019-12-14 19:46:02 +00:00
|
|
|
use DateTime;
|
2019-12-14 20:53:23 +00:00
|
|
|
use List::Util;
|
2019-03-21 21:12:45 +00:00
|
|
|
use Travel::Status::DE::IRIS::Stations;
|
|
|
|
use UUID::Tiny qw(:std);
|
|
|
|
|
|
|
|
sub make_token {
|
|
|
|
return create_uuid_as_string(UUID_V4);
|
|
|
|
}
|
|
|
|
|
2019-12-14 19:46:02 +00:00
|
|
|
sub sanitize {
|
|
|
|
my ( $type, $value ) = @_;
|
|
|
|
if ( not defined $value ) {
|
|
|
|
return undef;
|
|
|
|
}
|
|
|
|
if ( $type eq '' ) {
|
|
|
|
return '' . $value;
|
|
|
|
}
|
|
|
|
return 0 + $value;
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:29:43 +00:00
|
|
|
sub documentation {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
|
|
|
$self->render('api_documentation');
|
|
|
|
}
|
|
|
|
|
2019-04-24 05:34:41 +00:00
|
|
|
sub get_v1 {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
|
|
|
my $api_action = $self->stash('user_action');
|
|
|
|
my $api_token = $self->stash('token');
|
|
|
|
if ( $api_action !~ qr{ ^ (?: status | history | action ) $ }x ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
error => 'Invalid action',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ( $api_token !~ qr{ ^ (?<id> \d+ ) - (?<token> .* ) $ }x ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
error => 'Malformed token',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
my $uid = $+{id};
|
|
|
|
$api_token = $+{token};
|
2019-05-02 09:34:52 +00:00
|
|
|
|
|
|
|
if ( $uid > 2147483647 ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
error => 'Malformed token',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-04-24 05:34:41 +00:00
|
|
|
my $token = $self->get_api_token($uid);
|
|
|
|
if ( $api_token ne $token->{$api_action} ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
error => 'Invalid token',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ( $api_action eq 'status' ) {
|
2019-05-06 14:59:48 +00:00
|
|
|
$self->render( json => $self->get_user_status_json_v1($uid) );
|
2019-04-24 05:34:41 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
error => 'not implemented',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-14 20:53:23 +00:00
|
|
|
sub travel_v1 {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
2019-12-17 19:41:36 +00:00
|
|
|
my $payload = $self->req->json;
|
|
|
|
|
|
|
|
if ( not $payload or ref($payload) ne 'HASH' ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Malformed JSON',
|
2019-12-17 19:41:36 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-17 19:46:17 +00:00
|
|
|
if ( $self->app->mode ne 'development' ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
2019-12-17 19:46:17 +00:00
|
|
|
error =>
|
|
|
|
'This feature is incomplete and only available in development mode',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-14 20:53:23 +00:00
|
|
|
my $api_token = $payload->{token} // '';
|
|
|
|
|
|
|
|
if ( $api_token !~ qr{ ^ (?<id> \d+ ) - (?<token> .* ) $ }x ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Malformed token',
|
2019-12-14 20:53:23 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
my $uid = $+{id};
|
|
|
|
$api_token = $+{token};
|
|
|
|
|
|
|
|
if ( $uid > 2147483647 ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Malformed token',
|
2019-12-14 20:53:23 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $token = $self->get_api_token($uid);
|
2019-12-20 15:39:15 +00:00
|
|
|
if ( not $token->{'travel'} or $api_token ne $token->{'travel'} ) {
|
2019-12-14 20:53:23 +00:00
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Invalid token',
|
2019-12-14 20:53:23 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( not exists $payload->{action}
|
|
|
|
or $payload->{action} !~ m{^(checkin|checkout|undo)$} )
|
|
|
|
{
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Missing or invalid action',
|
2019-12-20 15:39:15 +00:00
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $payload->{action} eq 'checkin' ) {
|
|
|
|
my $from_station = sanitize( q{}, $payload->{fromStation} );
|
|
|
|
my $to_station = sanitize( q{}, $payload->{toStation} );
|
|
|
|
my $train_id;
|
|
|
|
|
2019-12-20 15:39:15 +00:00
|
|
|
if (
|
|
|
|
not(
|
|
|
|
$from_station
|
|
|
|
and ( ( $payload->{train}{type} and $payload->{train}{no} )
|
|
|
|
or $payload->{train}{id} )
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Missing fromStation or train data',
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-14 20:53:23 +00:00
|
|
|
if ( exists $payload->{train}{id} ) {
|
|
|
|
$train_id = sanitize( 0, $payload->{train}{id} );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
my $train_type = sanitize( q{}, $payload->{train}{type} );
|
|
|
|
my $train_no = sanitize( q{}, $payload->{train}{no} );
|
|
|
|
my $status = $self->get_departures( $from_station, 140, 40, 0 );
|
|
|
|
if ( $status->{errstr} ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
2019-12-20 17:33:59 +00:00
|
|
|
error =>
|
|
|
|
'Error requesting departures from fromStation: '
|
2019-12-14 20:53:23 +00:00
|
|
|
. $status->{errstr},
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
|
|
|
}
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
my ($train) = List::Util::first {
|
|
|
|
$_->type eq $train_type and $_->train_no eq $train_no
|
|
|
|
}
|
|
|
|
@{ $status->{results} };
|
|
|
|
if ( not defined $train ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
2019-12-20 17:33:59 +00:00
|
|
|
error => 'Train not found at fromStation',
|
2019-12-20 15:39:15 +00:00
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$train_id = $train->train_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
my ( $train, $error )
|
|
|
|
= $self->checkin( $from_station, $train_id, $uid );
|
2019-12-20 15:18:32 +00:00
|
|
|
if ( $payload->{comment} and not $error ) {
|
2019-12-14 22:46:36 +00:00
|
|
|
$self->update_in_transit_comment(
|
|
|
|
sanitize( q{}, $payload->{comment} ), $uid );
|
|
|
|
}
|
2019-12-14 20:53:23 +00:00
|
|
|
if ( $to_station and not $error ) {
|
|
|
|
( $train, $error ) = $self->checkout( $to_station, 0, $uid );
|
|
|
|
}
|
|
|
|
if ($error) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
2019-12-20 17:33:59 +00:00
|
|
|
error => 'Checkin/Checkout error: ' . $error,
|
2019-12-20 15:23:41 +00:00
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \1,
|
|
|
|
deprecated => \0,
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif ( $payload->{action} eq 'checkout' ) {
|
|
|
|
my $to_station = sanitize( q{}, $payload->{toStation} );
|
|
|
|
|
2019-12-20 15:39:15 +00:00
|
|
|
if ( not $to_station ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => 'Missing toStation',
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-14 22:46:36 +00:00
|
|
|
if ( $payload->{comment} ) {
|
|
|
|
$self->update_in_transit_comment(
|
|
|
|
sanitize( q{}, $payload->{comment} ), $uid );
|
|
|
|
}
|
|
|
|
|
2019-12-14 20:53:23 +00:00
|
|
|
my ( $train, $error )
|
|
|
|
= $self->checkout( $to_station, $payload->{force} ? 1 : 0, $uid );
|
|
|
|
if ($error) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
2019-12-20 17:33:59 +00:00
|
|
|
error => 'Checkout error: ' . $error,
|
2019-12-20 15:23:41 +00:00
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \1,
|
|
|
|
deprecated => \0,
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif ( $payload->{action} eq 'undo' ) {
|
|
|
|
my $error = $self->undo( 'in_transit', $uid );
|
|
|
|
if ($error) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \0,
|
|
|
|
deprecated => \0,
|
|
|
|
error => $error,
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
2019-12-20 15:23:41 +00:00
|
|
|
success => \1,
|
|
|
|
deprecated => \0,
|
|
|
|
status => $self->get_user_status_json_v1($uid)
|
2019-12-14 20:53:23 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-14 19:46:02 +00:00
|
|
|
sub import_v1 {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
2019-12-17 19:41:36 +00:00
|
|
|
my $payload = $self->req->json;
|
|
|
|
|
|
|
|
if ( not $payload or ref($payload) ne 'HASH' ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => 'Malformed JSON',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-17 19:46:17 +00:00
|
|
|
if ( $self->app->mode ne 'development' ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error =>
|
|
|
|
'This feature is incomplete and only available in development mode',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-14 19:46:02 +00:00
|
|
|
my $api_token = $payload->{token} // '';
|
|
|
|
|
|
|
|
if ( $api_token !~ qr{ ^ (?<id> \d+ ) - (?<token> .* ) $ }x ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
2019-12-17 19:41:36 +00:00
|
|
|
error => 'Malformed token',
|
2019-12-14 19:46:02 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
my $uid = $+{id};
|
|
|
|
$api_token = $+{token};
|
|
|
|
|
|
|
|
if ( $uid > 2147483647 ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => 'Malformed token',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $token = $self->get_api_token($uid);
|
|
|
|
if ( $api_token ne $token->{'import'} ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => 'Invalid token',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( not exists $payload->{fromStation}
|
|
|
|
or not exists $payload->{toStation} )
|
|
|
|
{
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => 'missing fromStation or toStation',
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
my %opt;
|
|
|
|
|
|
|
|
eval {
|
2019-12-17 19:09:02 +00:00
|
|
|
|
|
|
|
if ( not $payload->{fromStation}{name}
|
|
|
|
or not $payload->{toStation}{name} )
|
|
|
|
{
|
|
|
|
die("Missing fromStation/toStation name\n");
|
|
|
|
}
|
|
|
|
if ( not $payload->{train}{type} or not $payload->{train}{no} ) {
|
|
|
|
die("Missing train data\n");
|
|
|
|
}
|
|
|
|
if ( not $payload->{fromStation}{scheduledTime}
|
|
|
|
or not $payload->{toStation}{scheduledTime} )
|
|
|
|
{
|
|
|
|
die("Missing fromStation/toStation scheduledTime\n");
|
|
|
|
}
|
|
|
|
|
2019-12-14 19:46:02 +00:00
|
|
|
%opt = (
|
|
|
|
uid => $uid,
|
|
|
|
train_type => sanitize( q{}, $payload->{train}{type} ),
|
|
|
|
train_no => sanitize( q{}, $payload->{train}{no} ),
|
|
|
|
train_line => sanitize( q{}, $payload->{train}{line} ),
|
|
|
|
cancelled => $payload->{cancelled} ? 1 : 0,
|
|
|
|
dep_station => sanitize( q{}, $payload->{fromStation}{name} ),
|
|
|
|
arr_station => sanitize( q{}, $payload->{toStation}{name} ),
|
|
|
|
sched_departure =>
|
|
|
|
sanitize( 0, $payload->{fromStation}{scheduledTime} ),
|
|
|
|
rt_departure => sanitize(
|
|
|
|
0,
|
|
|
|
$payload->{fromStation}{realTime}
|
|
|
|
// $payload->{fromStation}{scheduledTime}
|
|
|
|
),
|
|
|
|
sched_arrival =>
|
|
|
|
sanitize( 0, $payload->{toStation}{scheduledTime} ),
|
|
|
|
rt_arrival => sanitize(
|
|
|
|
0,
|
|
|
|
$payload->{toStation}{realTime}
|
|
|
|
// $payload->{toStation}{scheduledTime}
|
|
|
|
),
|
|
|
|
comment => sanitize( q{}, $payload->{comment} ),
|
2019-12-17 19:09:02 +00:00
|
|
|
lax => $payload->{lax} ? 1 : 0,
|
2019-12-14 19:46:02 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
if ( $payload->{route} and ref( $payload->{route} ) eq 'ARRAY' ) {
|
|
|
|
$opt{route}
|
|
|
|
= [ map { sanitize( q{}, $_ ) } @{ $payload->{route} } ];
|
|
|
|
}
|
|
|
|
|
|
|
|
for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival))
|
|
|
|
{
|
|
|
|
$opt{$key} = DateTime->from_epoch(
|
|
|
|
time_zone => 'Europe/Berlin',
|
|
|
|
epoch => $opt{$key}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
if ($@) {
|
|
|
|
my ($first_line) = split( qr{\n}, $@ );
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => $first_line
|
|
|
|
}
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $db = $self->pg->db;
|
|
|
|
my $tx = $db->begin;
|
|
|
|
|
|
|
|
$opt{db} = $db;
|
|
|
|
my ( $journey_id, $error ) = $self->add_journey(%opt);
|
|
|
|
my $journey;
|
|
|
|
|
|
|
|
if ( not $error ) {
|
|
|
|
$journey = $self->get_journey(
|
|
|
|
uid => $uid,
|
|
|
|
db => $db,
|
|
|
|
journey_id => $journey_id,
|
|
|
|
verbose => 1
|
|
|
|
);
|
2019-12-17 19:01:39 +00:00
|
|
|
$error
|
|
|
|
= $self->journey_sanity_check( $journey, $payload->{lax} ? 1 : 0 );
|
2019-12-14 19:46:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($error) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \0,
|
|
|
|
error => $error
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
elsif ( $payload->{dryRun} ) {
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \1,
|
|
|
|
id => $journey_id,
|
|
|
|
result => $journey
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$tx->commit;
|
|
|
|
$self->render(
|
|
|
|
json => {
|
|
|
|
success => \1,
|
|
|
|
id => $journey_id,
|
|
|
|
result => $journey
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-21 21:12:45 +00:00
|
|
|
sub set_token {
|
|
|
|
my ($self) = @_;
|
|
|
|
if ( $self->validation->csrf_protect->has_error('csrf_token') ) {
|
|
|
|
$self->render( 'account', invalid => 'csrf' );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
my $token = make_token();
|
2019-03-22 15:56:49 +00:00
|
|
|
my $token_id = $self->app->token_type->{ $self->param('token') };
|
2019-03-21 21:12:45 +00:00
|
|
|
|
|
|
|
if ( not $token_id ) {
|
|
|
|
$self->redirect_to('account');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $self->param('action') eq 'delete' ) {
|
2019-04-22 10:11:22 +00:00
|
|
|
$self->pg->db->delete(
|
|
|
|
'tokens',
|
|
|
|
{
|
|
|
|
user_id => $self->current_user->{id},
|
|
|
|
type => $token_id
|
|
|
|
}
|
|
|
|
);
|
2019-03-21 21:12:45 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-04-22 10:11:22 +00:00
|
|
|
$self->pg->db->insert(
|
|
|
|
'tokens',
|
|
|
|
{
|
|
|
|
user_id => $self->current_user->{id},
|
|
|
|
type => $token_id,
|
|
|
|
token => $token
|
|
|
|
},
|
|
|
|
{
|
|
|
|
on_conflict => \
|
|
|
|
'(user_id, type) do update set token = EXCLUDED.token'
|
|
|
|
},
|
|
|
|
);
|
2019-03-21 21:12:45 +00:00
|
|
|
}
|
|
|
|
$self->redirect_to('account');
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|