aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm7
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm1
3 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 46ac10d36..8ec9eeaab 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -385,6 +385,9 @@ sub update_contacts : Private {
else {
$contact->unset_extra_metadata( 'inspection_required' );
}
+ if ( $c->get_param('reputation_threshold') ) {
+ $contact->set_extra_metadata( reputation_threshold => int($c->get_param('reputation_threshold')) );
+ }
if ( %errors ) {
$c->stash->{updated} = _('Please correct the errors below');
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 355a3f2a9..db3b16dcd 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -270,6 +270,8 @@ sub delete :Local :Args(1) {
$p->lastupdate( \'current_timestamp' );
$p->update;
+ $p->user->update_reputation(-1);
+
$c->model('DB::AdminLog')->create( {
admin_user => $c->user->email,
object_type => 'problem',
@@ -316,6 +318,7 @@ sub inspect : Private {
my $valid = 1;
my $update_text;
+ my $reputation_change = 0;
if ($permissions->{report_inspect}) {
foreach (qw/detailed_information traffic_information/) {
@@ -326,6 +329,7 @@ sub inspect : Private {
$update_text = Utils::cleanup_text( $c->get_param('public_update'), { allow_multiline => 1 } );
if ($update_text) {
$problem->set_extra_metadata( inspected => 1 );
+ $reputation_change = 1;
} else {
$valid = 0;
$c->stash->{errors} ||= [];
@@ -371,6 +375,9 @@ sub inspect : Private {
}
if ($valid) {
+ if ( $reputation_change != 0 ) {
+ $problem->user->update_reputation($reputation_change);
+ }
$problem->update;
if ( defined($update_text) ) {
$problem->add_to_comments( {
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 183b233a8..28f1aba43 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -207,6 +207,7 @@ sub generate : Private {
$out =~ s{(<link>.*?</link>)}{$1<uri>$uri</uri>};
$c->response->header('Content-Type' => 'application/xml; charset=utf-8');
+ $c->response->header('Access-Control-Allow-Origin' => '*');
$c->response->body( $out );
}