aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rwxr-xr-xweb/alert.cgi24
-rwxr-xr-xweb/confirm.cgi10
-rwxr-xr-xweb/reports.cgi4
-rwxr-xr-xweb/rss.cgi14
-rwxr-xr-xweb/tms-signup.cgi1
5 files changed, 26 insertions, 27 deletions
diff --git a/web/alert.cgi b/web/alert.cgi
index c6a6eb647..46eef082b 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -13,7 +13,7 @@ use Standard;
use Digest::SHA1 qw(sha1_hex);
use Error qw(:try);
use CrossSell;
-use mySociety::Alert;
+use FixMyStreet::Alert;
use mySociety::AuthToken;
use mySociety::Config;
use mySociety::DBHandle qw(select_all);
@@ -446,8 +446,8 @@ sub alert_signed_input {
my $out;
my $cobrand = Page::get_cobrand($q);
if ($signed_email eq sha1_hex("$id-$email-$salt-$secret")) {
- my $alert_id = mySociety::Alert::create($email, 'new_updates', $cobrand, '', $id);
- mySociety::Alert::confirm($alert_id);
+ my $alert_id = FixMyStreet::Alert::create($email, 'new_updates', $cobrand, '', $id);
+ FixMyStreet::Alert::confirm($alert_id);
$out = $q->p(_('You have successfully subscribed to that alert.'));
my $cobrand = Page::get_cobrand($q);
my $display_advert = Cobrand::allow_crosssell_adverts($cobrand);
@@ -476,14 +476,14 @@ sub alert_token {
my $message;
my $display_advert = Cobrand::allow_crosssell_adverts($cobrand);
if ($type eq 'subscribe') {
- mySociety::Alert::confirm($id);
+ FixMyStreet::Alert::confirm($id);
$message = _('You have successfully confirmed your alert.');
$out = $q->p($message);
if ($display_advert) {
$out .= CrossSell::display_advert($q, $email);
}
} elsif ($type eq 'unsubscribe') {
- mySociety::Alert::delete($id);
+ FixMyStreet::Alert::delete($id);
$message = _('You have successfully deleted your alert.');
$out = $q->p($message);
if ($display_advert) {
@@ -517,22 +517,22 @@ sub alert_do_subscribe {
my $cobrand_data = Cobrand::extra_alert_data($cobrand, $q);
if ($type eq 'updates') {
my $id = $q->param('id');
- $alert_id = mySociety::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $id);
+ $alert_id = FixMyStreet::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $id);
} elsif ($type eq 'problems') {
- $alert_id = mySociety::Alert::create($email, 'new_problems', $cobrand, $cobrand_data);
+ $alert_id = FixMyStreet::Alert::create($email, 'new_problems', $cobrand, $cobrand_data);
} elsif ($type eq 'local') {
my $feed = $q->param('feed');
if ($feed =~ /^area:(?:\d+:)?(\d+)/) {
- $alert_id = mySociety::Alert::create($email, 'area_problems', $cobrand, $cobrand_data, $1);
+ $alert_id = FixMyStreet::Alert::create($email, 'area_problems', $cobrand, $cobrand_data, $1);
} elsif ($feed =~ /^council:(\d+)/) {
- $alert_id = mySociety::Alert::create($email, 'council_problems', $cobrand, $cobrand_data, $1, $1);
+ $alert_id = FixMyStreet::Alert::create($email, 'council_problems', $cobrand, $cobrand_data, $1, $1);
} elsif ($feed =~ /^ward:(\d+):(\d+)/) {
- $alert_id = mySociety::Alert::create($email, 'ward_problems', $cobrand, $cobrand_data, $1, $2);
+ $alert_id = FixMyStreet::Alert::create($email, 'ward_problems', $cobrand, $cobrand_data, $1, $2);
} elsif ($feed =~ /^local:(\d+):(\d+)/) {
- $alert_id = mySociety::Alert::create($email, 'local_problems', $cobrand, $cobrand_data, $1, $2);
+ $alert_id = FixMyStreet::Alert::create($email, 'local_problems', $cobrand, $cobrand_data, $1, $2);
}
} else {
- throw mySociety::Alert::Error('Invalid type');
+ throw FixMyStreet::Alert::Error('Invalid type');
}
my %h = ();
diff --git a/web/confirm.cgi b/web/confirm.cgi
index 8e51a4555..ba2b6ee67 100755
--- a/web/confirm.cgi
+++ b/web/confirm.cgi
@@ -12,7 +12,7 @@ use strict;
use Standard;
use Digest::SHA1 qw(sha1_hex);
use CrossSell;
-use mySociety::Alert;
+use FixMyStreet::Alert;
use mySociety::AuthToken;
use mySociety::Random qw(random_bytes);
@@ -115,8 +115,8 @@ sub confirm_update {
# Subscribe updater to email updates if requested
if ($add_alert) {
- my $alert_id = mySociety::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $problem_id);
- mySociety::Alert::confirm($alert_id);
+ my $alert_id = FixMyStreet::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $problem_id);
+ FixMyStreet::Alert::confirm($alert_id);
}
return $out;
@@ -178,8 +178,8 @@ $q->p('<a href="/report/' . $id . '">' . _('View your report') . '</a>.');
}
# Subscribe problem reporter to email updates
- my $alert_id = mySociety::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $id);
- mySociety::Alert::confirm($alert_id);
+ my $alert_id = FixMyStreet::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $id);
+ FixMyStreet::Alert::confirm($alert_id);
return $out;
}
diff --git a/web/reports.cgi b/web/reports.cgi
index 4faee63f9..fe4213be4 100755
--- a/web/reports.cgi
+++ b/web/reports.cgi
@@ -12,7 +12,7 @@
use strict;
use Standard;
use URI::Escape;
-use mySociety::Alert;
+use FixMyStreet::Alert;
use mySociety::MaPit;
use mySociety::Web qw(ent NewURL);
use mySociety::VotingArea;
@@ -117,7 +117,7 @@ sub main {
}
print $q->header( -type => 'application/xml; charset=utf-8' );
my $xsl = Cobrand::feed_xsl($cobrand);
- my $out = mySociety::Alert::generate_rss($type, $xsl, "/$url", \@params, \%title_params, $cobrand, $q);
+ my $out = FixMyStreet::Alert::generate_rss($type, $xsl, "/$url", \@params, \%title_params, $cobrand, $q);
$out =~ s/matthew.fixmystreet/emptyhomes.matthew.fixmystreet/g if $q->{site} eq 'emptyhomes';
print $out;
return;
diff --git a/web/rss.cgi b/web/rss.cgi
index 5386526df..effa15f08 100755
--- a/web/rss.cgi
+++ b/web/rss.cgi
@@ -12,7 +12,7 @@ use strict;
use Error qw(:try);
use Standard;
use URI::Escape;
-use mySociety::Alert;
+use FixMyStreet::Alert;
use mySociety::MaPit;
use mySociety::GeoUtil;
use mySociety::Gaze;
@@ -34,20 +34,20 @@ sub main {
return;
}
my $qs = 'report/' . $id;
- $out = mySociety::Alert::generate_rss($type, $xsl, $qs, [$id], undef, $cobrand, $q);
+ $out = FixMyStreet::Alert::generate_rss($type, $xsl, $qs, [$id], undef, $cobrand, $q);
} elsif ($type eq 'new_problems' || $type eq 'new_fixed_problems') {
- $out = mySociety::Alert::generate_rss($type, $xsl, '', undef, undef, $cobrand, $q);
+ $out = FixMyStreet::Alert::generate_rss($type, $xsl, '', undef, undef, $cobrand, $q);
} elsif ($type eq 'council_problems') {
my $id = $q->param('id');
my $qs = '/'.$id;
- $out = mySociety::Alert::generate_rss($type, $xsl, $qs, [$id], undef, $cobrand. $q);
+ $out = FixMyStreet::Alert::generate_rss($type, $xsl, $qs, [$id], undef, $cobrand. $q);
} elsif ($type eq 'area_problems') {
my $id = $q->param('id');
my $va_info = mySociety::MaPit::call('area', $id);
my $qs = '/'.$id;
- $out = mySociety::Alert::generate_rss($type, $xsl, $qs, [$id], { NAME => $va_info->{name} }, $cobrand, $q);
+ $out = FixMyStreet::Alert::generate_rss($type, $xsl, $qs, [$id], { NAME => $va_info->{name} }, $cobrand, $q);
} elsif ($type eq 'all_problems') {
- $out = mySociety::Alert::generate_rss($type, $xsl, '', undef, undef, $cobrand, $q);
+ $out = FixMyStreet::Alert::generate_rss($type, $xsl, '', undef, undef, $cobrand, $q);
} else {
my $base = mySociety::Config::get('BASE_URL');
print $q->redirect($base . '/alert');
@@ -114,6 +114,6 @@ sub rss_local_problems {
}
my $xsl = Cobrand::feed_xsl($cobrand);
- return mySociety::Alert::generate_rss('local_problems', $xsl, $qs, [$e, $n, $d], undef, $cobrand, $q);
+ return FixMyStreet::Alert::generate_rss('local_problems', $xsl, $qs, [$e, $n, $d], undef, $cobrand, $q);
}
diff --git a/web/tms-signup.cgi b/web/tms-signup.cgi
index 2bafd1543..44099417f 100755
--- a/web/tms-signup.cgi
+++ b/web/tms-signup.cgi
@@ -12,7 +12,6 @@ use strict;
use Standard;
use Digest::SHA1 qw(sha1_hex);
use CrossSell;
-use mySociety::Alert;
use mySociety::AuthToken;
use mySociety::Config;
use mySociety::EmailUtil qw(is_valid_email);