aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Location.pm16
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm8
3 files changed, 28 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm
index 4312b6911..8a68b2b3d 100644
--- a/perllib/FixMyStreet/App/Controller/Location.pm
+++ b/perllib/FixMyStreet/App/Controller/Location.pm
@@ -131,6 +131,22 @@ sub check_location : Private {
return 1;
}
+=head2 country_message
+
+Displays the country_message template, used for displaying a message to
+people using the site from outside the host country.
+
+=cut
+
+sub country_message : Path('/country_message') : Args(0) {
+ my ( $self, $c ) = @_;
+
+ # we do not want to cache this as we always want to check if displaying this
+ # is the right thing to do.
+ $c->res->header( 'Cache_Control' => 'max-age=0' );
+ $c->stash->{template} = 'front/international_banner.html';
+}
+
# Utility function for if someone (rarely) enters a grid reference
sub gridref_to_latlon {
my ( $a, $b, $num ) = @_;
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index c8bae90e6..34ad5790f 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -878,5 +878,9 @@ sub updates_as_hashref {
return {};
}
+sub get_country_for_ip_address {
+ return 0;
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
index ce62e206e..36f381085 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
@@ -1,5 +1,6 @@
package FixMyStreet::Cobrand::FixMyStreet;
use base 'FixMyStreet::Cobrand::UK';
+use mySociety::Gaze;
use constant COUNCIL_ID_BROMLEY => 2482;
@@ -39,5 +40,12 @@ sub extra_contact_validation {
return %errors;
}
+sub get_country_for_ip_address {
+ my $self = shift;
+ my $ip = shift;
+
+ return mySociety::Gaze::get_country_from_ip($ip);
+}
+
1;