diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Contact.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index fb525fc1f..e2b76ca60 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -26,9 +26,14 @@ Functions to run on both GET and POST contact requests. sub auto : Private { my ($self, $c) = @_; + $c->forward('/auth/get_csrf_token'); +} + +sub begin : Private { + my ($self, $c) = @_; + $c->forward('/begin'); $c->forward('setup_request'); $c->forward('determine_contact_type'); - $c->forward('/auth/get_csrf_token'); } =head2 index @@ -106,7 +111,14 @@ sub determine_contact_type : Private { $c->stash->{rejecting_report} = 1; } } elsif ( $c->cobrand->abuse_reports_only ) { - $c->detach( '/page_error_404_not_found' ); + # General enquiries replaces contact form if enabled + if ( $c->cobrand->can('setup_general_enquiries_stash') ) { + $c->res->redirect( '/contact/enquiry' ); + $c->detach; + return 1; + } else { + $c->detach( '/page_error_404_not_found' ); + } } return 1; |