summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm37
1 files changed, 8 insertions, 29 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 6fd2ee2..6ab89fe 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -209,17 +209,6 @@ sub startup {
}
);
$self->attr(
- set_status_query => sub {
- my ($self) = @_;
-
- return $self->app->dbh->prepare(
- qq{
- update users set status = ? where id = ?;
- }
- );
- }
- );
- $self->attr(
mark_for_deletion_query => sub {
my ($self) = @_;
@@ -448,19 +437,6 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
}
);
$self->attr(
- get_token_query => sub {
- my ($self) = @_;
-
- return $self->app->dbh->prepare(
- qq{
- select
- name, status, token
- from users where id = ?
- }
- );
- }
- );
- $self->attr(
get_stationid_by_ds100_query => sub {
my ($self) = @_;
@@ -1019,11 +995,14 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
'get_user_token' => sub {
my ( $self, $uid ) = @_;
- my $query = $self->app->get_token_query;
- $query->execute($uid);
- my $rows = $query->fetchall_arrayref;
- if ( @{$rows} ) {
- return @{ $rows->[0] };
+ my $res = $self->pg->db->select(
+ 'users',
+ [ 'name', 'status', 'token' ],
+ { id => $uid }
+ );
+
+ if ( my $ret = $res->array ) {
+ return @{$ret};
}
return;
}