summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-06 11:20:10 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-06 11:20:10 +0200
commit1405eb6ea3fe95fcb9c205c6c4c250433d48819c (patch)
tree4845cce466ea882369242290855fc5de0c0ebb3d /lib/Travelynx.pm
parent6630cdcd9e943a9a8c2cce49b6b5e59bd6ef6710 (diff)
Add password change form
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 3de3b9e..b9132f3 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -583,7 +583,8 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
elsif ( $user->{cancelled} ) {
# Same
- $self->checkout($station, 1, $self->app->action_type->{cancelled_to});
+ $self->checkout( $station, 1,
+ $self->app->action_type->{cancelled_to} );
}
my $success = $self->app->action_query->execute(
@@ -877,6 +878,13 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
);
$self->helper(
+ 'set_user_password' => sub {
+ my ( $self, $uid, $password ) = @_;
+ $self->app->set_password_query->execute( $password, $uid );
+ }
+ );
+
+ $self->helper(
'check_if_user_name_exists' => sub {
my ( $self, $user_name ) = @_;
@@ -1322,12 +1330,14 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
);
$authed_r->get('/account')->to('account#account');
+ $authed_r->get('/change_password')->to('account#password_form');
$authed_r->get('/export.json')->to('account#json_export');
$authed_r->get('/history')->to('traveling#history');
$authed_r->get('/history/:year/:month')->to('traveling#monthly_history');
$authed_r->get('/history.json')->to('traveling#json_history');
$authed_r->get('/journey/:id')->to('traveling#journey_details');
$authed_r->get('/s/*station')->to('traveling#station');
+ $authed_r->post('/change_password')->to('account#change_password');
$authed_r->post('/delete')->to('account#delete');
$authed_r->post('/logout')->to('account#do_logout');
$authed_r->post('/set_token')->to('api#set_token');