summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-06-14 19:30:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-06-14 19:30:58 +0200
commit95674ee2ea3f2596356bcec654640f1990b31aaa (patch)
treefa1e6d443e5a4625fe036ce5e24574e46704276e /lib/Travelynx/Controller
parent1803a1723c2952723a4ec9ad67e3cd1184fcf137 (diff)
Add explanation to name change page
Diffstat (limited to 'lib/Travelynx/Controller')
-rw-r--r--lib/Travelynx/Controller/Account.pm21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm
index 9c161e0..db02dd1 100644
--- a/lib/Travelynx/Controller/Account.pm
+++ b/lib/Travelynx/Controller/Account.pm
@@ -470,18 +470,27 @@ sub change_name {
if ( $self->validation->csrf_protect->has_error('csrf_token') ) {
$self->render(
'change_name',
+ name => $old_name,
invalid => 'csrf',
);
return;
}
if ( my $error = $self->users->is_name_invalid( name => $new_name ) ) {
- $self->render( 'change_name', invalid => $error );
+ $self->render(
+ 'change_name',
+ name => $old_name,
+ invalid => $error
+ );
return;
}
if ( not $self->authenticate( $old_name, $self->param('password') ) ) {
- $self->render( 'change_name', invalid => 'password' );
+ $self->render(
+ 'change_name',
+ name => $old_name,
+ invalid => 'password'
+ );
return;
}
@@ -495,7 +504,11 @@ sub change_name {
);
if ( not $success ) {
- $self->render( 'change_name', invalid => 'user_collision' );
+ $self->render(
+ 'change_name',
+ name => $old_name,
+ invalid => 'user_collision'
+ );
return;
}
@@ -530,7 +543,7 @@ sub change_name {
'travelynx: Name geƤndert', $body );
}
else {
- $self->render('change_name');
+ $self->render( 'change_name', name => $old_name );
}
}