aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-12-02 17:14:23 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-01-08 11:36:27 +0000
commita7ecb8d29a4a45bec16c9ddd0b2ce3a50b993a8c (patch)
treea06e007fd2de81941b6825ff44d35b915bf6c30b /perllib/FixMyStreet/App/Controller/Report
parent27fe9940d3830b6a9d23c82aeca5a93975eee5c3 (diff)
Allow report as another user with only name.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index db469f130..650881da3 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -838,9 +838,11 @@ sub process_user : Private {
my $user = $c->user->obj;
if ($c->stash->{contributing_as_another_user}) {
- # Act as if not logged in (and it will be auto-confirmed later on)
- $report->user(undef);
- last;
+ if ($params{username} || $params{phone}) {
+ # Act as if not logged in (and it will be auto-confirmed later on)
+ $report->user(undef);
+ last;
+ }
}
$report->user( $user );
@@ -854,6 +856,8 @@ sub process_user : Private {
$report->name($name);
$user->name($name) unless $user->name;
$c->stash->{no_reporter_alert} = 1;
+ } elsif ($c->stash->{contributing_as_another_user}) {
+ $c->stash->{no_reporter_alert} = 1;
}
return 1;
@@ -1595,6 +1599,7 @@ sub redirect_or_confirm_creation : Private {
# Subscribe problem reporter to email updates
$c->forward( 'create_reporter_alert' );
if ($c->stash->{contributing_as_another_user} && $report->user->email
+ && $report->user->id != $c->user->id
&& !$c->cobrand->report_sent_confirmation_email) {
$c->send_email( 'other-reported.txt', {
to => [ [ $report->user->email, $report->name ] ],