aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rwxr-xr-xweb/alert.cgi19
-rwxr-xr-xweb/confirm.cgi18
2 files changed, 21 insertions, 16 deletions
diff --git a/web/alert.cgi b/web/alert.cgi
index 8564737ab..ba7cece79 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: alert.cgi,v 1.33 2008-10-08 14:38:29 matthew Exp $
+# $Id: alert.cgi,v 1.34 2008-12-01 12:19:13 matthew Exp $
use strict;
use Standard;
@@ -162,18 +162,21 @@ sub alert_list {
push @options,
[ 'council', $district->{area_id}, Page::short_name($district->{name}), $district->{name} ],
[ 'ward', $district->{area_id}.':'.$d_ward->{area_id}, Page::short_name($district->{name}) . '/' . Page::short_name($d_ward->{name}),
- "$district->{name}, within $d_ward->{name} ward" ],
- [ 'council', $county->{area_id}, Page::short_name($county->{name}), $county->{name} ],
- [ 'ward', $county->{area_id}.':'.$c_ward->{area_id}, Page::short_name($county->{name}) . '/'
- . Page::short_name($c_ward->{name}), "$county->{name}, within $c_ward->{name} ward" ];
- $options .= $q->p($q->strong(_('Or problems reported to:'))) .
- $q->ul(alert_list_options($q, @options));
- $options .= $q->p($q->small(_('FixMyStreet sends different categories of problem
+ "$district->{name}, within $d_ward->{name} ward" ];
+ if ($q->site ne 'emptyhomes') {
+ push @options,
+ [ 'council', $county->{area_id}, Page::short_name($county->{name}), $county->{name} ],
+ [ 'ward', $county->{area_id}.':'.$c_ward->{area_id}, Page::short_name($county->{name}) . '/'
+ . Page::short_name($c_ward->{name}), "$county->{name}, within $c_ward->{name} ward" ];
+ $options .= $q->p($q->strong(_('Or problems reported to:'))) .
+ $q->ul(alert_list_options($q, @options));
+ $options .= $q->p($q->small(_('FixMyStreet sends different categories of problem
to the appropriate council, so problems within the boundary of a particular council
might not match the problems sent to that council. For example, a graffiti report
will be sent to the district council, so will appear in both of the district
council’s alerts, but will only appear in the "Within the boundary" alert
for the county council.')));
+ }
$options .= '</div>
<div id="rss_buttons">
';
diff --git a/web/confirm.cgi b/web/confirm.cgi
index b4f637720..baf365e70 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.50 2008-11-17 22:42:12 matthew Exp $
+# $Id: confirm.cgi,v 1.51 2008-12-01 12:19:13 matthew Exp $
use strict;
use Standard;
@@ -59,15 +59,17 @@ sub confirm_update {
$add_alert = $data->{add_alert};
}
- #if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($email))) {
- # dbh()->do("update comment set state='hidden' where id=?", {}, $id);
- # return $q->p('Sorry, there has been an error confirming your update.');
- #} else {
- dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id);
- #}
-
my ($problem_id, $fixed, $email, $name) = dbh()->selectrow_array(
"select problem_id, mark_fixed, email, name from comment where id=?", {}, $id);
+
+ (my $domain = $email) =~ s/^.*\@//;
+ if (dbh()->selectrow_array('select email from abuse where lower(email)=? or lower(email)=?', {}, lc($email), lc($domain))) {
+ dbh()->do("update comment set state='hidden' where id=?", {}, $id);
+ return $q->p('Sorry, there has been an error confirming your update.');
+ } else {
+ dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id);
+ }
+
my $creator_fixed = 0;
if ($fixed) {
dbh()->do("update problem set state='fixed', lastupdate = ms_current_timestamp()