aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Contact.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2014-04-09 17:09:14 +0100
committerStruan Donald <struan@exo.org.uk>2014-04-15 15:53:18 +0100
commit565c6498aefea0fd39ec7453019bbf86b52672dd (patch)
treefa11d5c90de95202da33086a56285b6a348aee88 /perllib/FixMyStreet/App/Controller/Contact.pm
parentb82228ce014cc87866d976eeb3ce6e454e87c336 (diff)
Add a who are you trying to contact option to contact form
In order to try and cut down on people mistakingly using this form to try and contact their council all some 'who are you trying to contact' options to the form that display appropriate messaged unless the 'FMS team option is selected. Add the validation code for this in the cobrand module. Fixes #41
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Contact.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Contact.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm
index 7ba18ed2d..6bc6e90ef 100644
--- a/perllib/FixMyStreet/App/Controller/Contact.pm
+++ b/perllib/FixMyStreet/App/Controller/Contact.pm
@@ -108,6 +108,11 @@ sub validate : Private {
if !mySociety::EmailUtil::is_valid_email( $c->req->param('em') );
}
+ %field_errors = (
+ %field_errors,
+ $c->cobrand->extra_contact_validation($c)
+ );
+
push @errors, _('Illegal ID')
if $c->req->param('id') && $c->req->param('id') !~ /^[1-9]\d*$/
or $c->req->param('update_id')