diff options
author | matthew <matthew> | 2007-07-11 16:39:02 +0000 |
---|---|---|
committer | matthew <matthew> | 2007-07-11 16:39:02 +0000 |
commit | 03224d0295334e568164529dcd53863abb973905 (patch) | |
tree | f392878971d53722416110eb7d40dec4b726c333 | |
parent | 2a3611dff114ba5ba4897dc6838185e5d67cd3fc (diff) |
More abuse dealing.
-rwxr-xr-x | bin/send-reports | 3 | ||||
-rwxr-xr-x | web/confirm.cgi | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/bin/send-reports b/bin/send-reports index 9028bcf73..a8faf3779 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.43 2007-07-11 16:28:13 matthew Exp $ +# $Id: send-reports,v 1.44 2007-07-11 16:39:02 matthew Exp $ use strict; require 5.8.0; @@ -54,6 +54,7 @@ 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}); + dbh()->commit(); next; } # XXX Needs locks! diff --git a/web/confirm.cgi b/web/confirm.cgi index da7a6d07f..fd0b58845 100755 --- a/web/confirm.cgi +++ b/web/confirm.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: confirm.cgi,v 1.25 2007-07-09 17:40:29 matthew Exp $ +# $Id: confirm.cgi,v 1.26 2007-07-11 16:39:02 matthew Exp $ use strict; require 5.8.0; @@ -100,9 +100,15 @@ sub confirm_update { sub confirm_problem { my ($q, $id) = @_; - dbh()->do("update problem set state='confirmed', confirmed=ms_current_timestamp(), lastupdate=ms_current_timestamp() - where id=? and state='unconfirmed'", {}, $id); + my ($council, $email) = dbh()->selectrow_array("select council, email from problem where id=?", {}, $id); + + if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($email))) { + dbh()->do("update problem set state='hidden', lastupdate=ms_current_timestamp() where id=?", {}, $id); + } else { + dbh()->do("update problem set state='confirmed', confirmed=ms_current_timestamp(), lastupdate=ms_current_timestamp() + where id=? and state='unconfirmed'", {}, $id); + } my $out = '<form action="/alert" method="post">'; $out .= $q->p( _('You have successfully confirmed your problem') |