aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-04-12 12:32:58 +0100
committerEdmund von der Burg <evdb@mysociety.org>2011-04-12 12:32:58 +0100
commita38d76783ee9a44b9e237a87d086549677d3282e (patch)
tree1580137faa451b0c03b62837f7762ef9da932864 /perllib/FixMyStreet/App/Controller
parent94f4797c17b9c439579645f202726ba65499a78d (diff)
Redirect locations queries from '/' to '/around'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Root.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Root.pm b/perllib/FixMyStreet/App/Controller/Root.pm
index 461105b68..2dc770da5 100644
--- a/perllib/FixMyStreet/App/Controller/Root.pm
+++ b/perllib/FixMyStreet/App/Controller/Root.pm
@@ -33,11 +33,31 @@ sub auto : Private {
=head2 index
+Home page.
+
+If request includes certain parameters redirect to '/around' - this is to
+preserve old behaviour.
+
=cut
sub index : Path : Args(0) {
my ( $self, $c ) = @_;
+ my @old_param_keys = ( 'pc', 'x', 'y', 'lat', 'lon' );
+ my %old_params = ();
+
+ foreach my $key (@old_param_keys) {
+ my $val = $c->req->param($key);
+ next unless $val;
+ $old_params{$key} = $val;
+ }
+
+ if ( scalar keys %old_params ) {
+ my $around_uri = $c->uri_for( '/around', \%old_params );
+ $c->res->redirect($around_uri);
+ return;
+ }
+
}
=head2 default