Add explanation to name change page
This commit is contained in:
parent
1803a1723c
commit
95674ee2ea
2 changed files with 32 additions and 4 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,21 @@
|
|||
% }
|
||||
|
||||
<h1>Name ändern</h1>
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<p>
|
||||
Hier kannst du den Namen deines Accounts ändern. Dieser bestimmt die
|
||||
URL deiner <a href="/status/<%= $name %>">Status</a>- und <a
|
||||
href="/p/<%= $name %>">Profilseite</a> und den Accountnamen beim
|
||||
Anmelden.
|
||||
</p>
|
||||
<p>
|
||||
Beachte, dass der alte Name direkt nach der Umbenennung freigegeben
|
||||
wird und von anderen Accounts belegt werden kann. Für die alten
|
||||
Status- und Profilseiten werden keine Weiterleitungen eingerichtet.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
%= form_for '/account/name' => (method => 'POST') => begin
|
||||
%= csrf_field
|
||||
<div class="row">
|
||||
|
|
Loading…
Reference in a new issue