aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/send-reports7
-rw-r--r--db/schema.sql8
2 files changed, 13 insertions, 2 deletions
diff --git a/bin/send-reports b/bin/send-reports
index cbd65fc36..9028bcf73 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: send-reports,v 1.42 2007-06-20 10:34:17 matthew Exp $
+# $Id: send-reports,v 1.43 2007-07-11 16:28:13 matthew Exp $
use strict;
require 5.8.0;
@@ -51,6 +51,11 @@ my $unsent = dbh()->selectall_arrayref(
AND council IS NOT NULL", { Slice => {} });
foreach my $row (@$unsent) {
+
+ if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($row->{email}))) {
+ dbh()->do("update problem set state='hidden' where id=?", {}, $row->{id});
+ next;
+ }
# XXX Needs locks!
my @all_councils = split /,|\|/, $row->{council};
my ($councils, $missing) = $row->{council} =~ /^([\d,]+)(?:\|([\d,]+))?/;
diff --git a/db/schema.sql b/db/schema.sql
index 55eeaf4a0..eea52a777 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -4,7 +4,7 @@
-- Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-- Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
--
--- $Id: schema.sql,v 1.35 2007-06-18 15:31:00 matthew Exp $
+-- $Id: schema.sql,v 1.36 2007-07-11 16:28:13 matthew Exp $
--
-- secret
@@ -293,3 +293,9 @@ create table flickr_imported (
problem_id integer not null references problem(id)
);
create unique index flickr_imported_id_idx on flickr_imported(id);
+
+create table abuse (
+ email text not null
+);
+create unique index abuse_email_idx on abuse(lower(email));
+