aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 99eae8659..4a5b8db5d 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -156,7 +156,7 @@ sub process_user : Private {
if ($params{password_register}) {
$c->forward('/auth/test_password', [ $params{password_register} ]);
- $update->user->password(Utils::trim_text($params{password_register}));
+ $update->user->password($params{password_register});
}
return 1;
@@ -240,6 +240,7 @@ This makes sure we only proceed to processing if we've had the form submitted
sub check_form_submitted : Private {
my ( $self, $c ) = @_;
+ return if $c->stash->{problem}->get_extra_metadata('closed_updates');
return $c->get_param('submit_update') || '';
}
@@ -444,9 +445,17 @@ sub save_update : Private {
if ( $c->cobrand->never_confirm_updates ) {
$update->user->update_or_insert;
$update->confirm();
- } elsif ( $c->forward('/report/new/created_as_someone_else', [ $update->problem->bodies_str ]) ) {
- # If created on behalf of someone else, we automatically confirm it,
- # but we don't want to update the user account
+ # If created on behalf of someone else, we automatically confirm it,
+ # but we don't want to update the user account
+ } elsif ($c->stash->{contributing_as_another_user}) {
+ $update->set_extra_metadata( contributed_as => 'another_user');
+ $update->set_extra_metadata( contributed_by => $c->user->id );
+ $update->confirm();
+ } elsif ($c->stash->{contributing_as_body}) {
+ $update->set_extra_metadata( contributed_as => 'body' );
+ $update->confirm();
+ } elsif ($c->stash->{contributing_as_anonymous_user}) {
+ $update->set_extra_metadata( contributed_as => 'anonymous_user' );
$update->confirm();
} elsif ( !$update->user->in_storage ) {
# User does not exist.