aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm4
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm2
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 6f6428089..a3df4aa82 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -272,9 +272,11 @@ sub by_category_ajax_data : Private {
}
my $non_public = $c->stash->{non_public_categories}->{$category};
+ my $anon_button = ($c->cobrand->allow_anonymous_reports($category) eq 'button');
my $body = {
bodies => [ map { $_->name } @bodies ],
$non_public ? ( non_public => JSON->true ) : (),
+ $anon_button ? ( allow_anonymous => JSON->true ) : (),
};
if ( $c->stash->{category_extras}->{$category} && @{ $c->stash->{category_extras}->{$category} } >= 1 ) {
@@ -984,7 +986,7 @@ sub process_report : Private {
$c->stash->{contributing_as_anonymous_user} = $user->contributing_as('anonymous_user', $c, $c->stash->{bodies});
}
# This is also done in process_user, but is needed here for anonymous() just below
- my $anon_button = $c->cobrand->allow_anonymous_reports eq 'button' && $c->get_param('report_anonymously');
+ my $anon_button = $c->cobrand->allow_anonymous_reports($params{category}) eq 'button' && $c->get_param('report_anonymously');
if ($anon_button) {
$c->stash->{contributing_as_anonymous_user} = 1;
$c->stash->{contributing_as_body} = undef;
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 73c179751..aa46a5c43 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -107,7 +107,7 @@ sub send(;$) {
$h{osm_url} .= '?m';
}
- if ( $cobrand->allow_anonymous_reports &&
+ if ( $cobrand->allow_anonymous_reports($row->category) &&
$row->user->email eq $cobrand->anonymous_account->{'email'}
) {
$h{anonymous_report} = 1;