diff options
-rw-r--r-- | perllib/Page.pm | 12 | ||||
-rwxr-xr-x | web/alert.cgi | 19 | ||||
-rwxr-xr-x | web/confirm.cgi | 18 |
3 files changed, 30 insertions, 19 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index 71f519e46..62e6a0997 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: Page.pm,v 1.127 2008-11-17 22:58:51 matthew Exp $ +# $Id: Page.pm,v 1.128 2008-12-01 12:19:13 matthew Exp $ # package Page; @@ -490,6 +490,7 @@ sub os_to_px_with_adjust { } # send_email TO (NAME) TEMPLATE-NAME PARAMETERS +# TEMPLATE-NAME is currently one of _(problem), update, alert, tms sub send_email { my ($q, $email, $name, $thing, %h) = @_; my $template = "$thing-confirm"; @@ -505,14 +506,19 @@ sub send_email { To => $to, }, $email); - my $action = ($thing eq 'alert') ? 'confirmed' : 'posted'; + my $action = 'posted'; # problem, update + if ($thing eq 'alert') { + $action = 'activated'; + } elsif ($thing eq 'tms') { + $action = 'registered'; + } $thing .= ' report' if $thing eq _('problem'); $thing = 'expression of interest' if $thing eq 'tms'; my $out = <<EOF; <h1>Nearly Done! Now check your email...</h1> <p>The confirmation email <strong>may</strong> take a few minutes to arrive — <em>please</em> be patient.</p> <p>If you use web-based email or have 'junk mail' filters, you may wish to check your bulk/spam mail folders: sometimes, our messages are marked that way.</p> -<p>You must now click on the link within the email we've just sent you — +<p>You must now click the link in the email we've just sent you — if you do not, your $thing will not be $action.</p> <p>(Don't worry — we'll hang on to your $thing while you're checking your email.)</p> EOF 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() |