diff options
-rw-r--r-- | conf/httpd.conf | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 2 | ||||
-rw-r--r-- | perllib/Problems.pm | 14 |
3 files changed, 13 insertions, 7 deletions
diff --git a/conf/httpd.conf b/conf/httpd.conf index 8127da2d1..00532a3ab 100644 --- a/conf/httpd.conf +++ b/conf/httpd.conf @@ -49,8 +49,8 @@ RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^(.+)/$ $1 [R=permanent] # Confirmation tokens -RewriteRule ^/[Aa]/([0-9A-Za-z]{16,18}).*$ /alert.cgi?token=$1 [QSA,L] -RewriteRule ^/[Cc]/([0-9A-Za-z]{16,18}).*$ /confirm.cgi?type=update;token=$1 [QSA,L] +# RewriteRule ^/[Aa]/([0-9A-Za-z]{16,18}).*$ /alert.cgi?token=$1 [QSA,L] +# RewriteRule ^/[Cc]/([0-9A-Za-z]{16,18}).*$ /confirm.cgi?type=update;token=$1 [QSA,L] # RewriteRule ^/[Qq]/([0-9A-Za-z]{16,18}).*$ /questionnaire.cgi?token=$1 [QSA,L] RewriteRule ^/[Ff]/([0-9A-Za-z]{16,18}).*$ /flickr.cgi?token=$1 [L] diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index e8bb0f70d..a0c332b40 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -318,7 +318,7 @@ sub signup_for_alerts : Private { my $alert = $c->model( 'DB::Alert' )->find_or_create( user => $c->stash->{update}->user, alert_type => 'new_updates', - parameter => $c->stash->{problem}->id + parameter => $c->stash->{update}->problem_id, ); $alert->update; diff --git a/perllib/Problems.pm b/perllib/Problems.pm index 48203b980..02ac2b384 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -503,11 +503,13 @@ Uses any site_restriction defined by a cobrand. =cut sub timeline_problems { my $current_timestamp = current_timestamp(); - my $problems = select_all("select state,id,name,email,title,council,category,service,cobrand,cobrand_data, + my $problems = select_all("select state,problem.id,problem.name,users.email,title,council,category,service,cobrand,cobrand_data, extract(epoch from created) as created, extract(epoch from confirmed) as confirmed, extract(epoch from whensent) as whensent - from problem where (created>=$current_timestamp-'7 days'::interval + from problem, users + where problem.user_id = users.id + and (created>=$current_timestamp-'7 days'::interval or confirmed>=$current_timestamp-'7 days'::interval or whensent>=$current_timestamp-'7 days'::interval) $site_restriction"); @@ -525,9 +527,11 @@ Uses any site_restriction defined by a cobrand. sub timeline_updates { my $updates = select_all("select comment.*, extract(epoch from comment.created) as created, + users.email, problem.council - from comment, problem + from comment, problem, users where comment.problem_id = problem.id + and comment.user_id = users.id and comment.state='confirmed' and comment.created>=" . current_timestamp() . "-'7 days'::interval $site_restriction"); @@ -548,7 +552,9 @@ sub timeline_alerts { } my $alerts = select_all("select *, extract(epoch from whensubscribed) as whensubscribed - from alert where whensubscribed>=" . current_timestamp() . "-'7 days'::interval + from alert, users + where alert.user_id = users.id + and whensubscribed>=" . current_timestamp() . "-'7 days'::interval and confirmed=1 $cobrand_clause"); return $alerts; |