diff options
-rw-r--r-- | conf/general-example | 3 | ||||
-rw-r--r-- | notes/INSTALL | 4 | ||||
-rwxr-xr-x | web/index.cgi | 8 |
3 files changed, 10 insertions, 5 deletions
diff --git a/conf/general-example b/conf/general-example index 9b3214539..87973d9e0 100644 --- a/conf/general-example +++ b/conf/general-example @@ -33,6 +33,9 @@ define('OPTION_DRESS_DB_PASS', ''); define('OPTION_BASE_URL', 'http://www.example.org'); +# Which country are you operating in? ISO3166-alpha2 code please +define('OPTION_COUNTRY', 'GB'); + define('OPTION_TESTING_EMAIL', 'testing@example.com'); define('OPTION_EMAIL_DOMAIN', 'example.org'); define('OPTION_CONTACT_EMAIL', 'team@'.OPTION_EMAIL_DOMAIN); diff --git a/notes/INSTALL b/notes/INSTALL index 5254a6982..fcb1f5579 100644 --- a/notes/INSTALL +++ b/notes/INSTALL @@ -82,14 +82,14 @@ mail youremail@example.com # send a test message cp conf/general-example conf/general nano conf/general -# You only need to alter: +# You may need to alter: # * the database connection details # * the OPTION_BASE_URL to be where your test site will run - eg 'http://localhost' # * the OPTION_EVEL_URL to '' - this will cause some emails not to be sent but warned to STDERR instead - proper email handling is being worked on # * the OPTION_SMTP_SMARTHOST to '' if routing mail via ssmtp as described above - otherwise your SMTP server # * set OPTION_EMAIL_VHOST to the same as OPTION_BASE_URL minus the 'http://' - eg 'localhost' # * set OPTION_UPLOAD_CACHE and OPTION_GEO_CACHE to your preferred values - +# * set OPTION_COUNTRY to your ISO3166 alpha2 code ('GB' for the United Kingdom: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) # SETTING UP THE DATABASES diff --git a/web/index.cgi b/web/index.cgi index e0c16ad30..64434a68f 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -265,15 +265,17 @@ sub submit_problem { my @errors; my %field_errors; - if ($input{lat}) { + + # If in UK and we have a lat,lon coocdinate check it is in UK + if ( $input{lat} && mySociety::Config::get('COUNTRY') eq 'GB' ) { try { - ($input{easting}, $input{northing}) = mySociety::GeoUtil::wgs84_to_national_grid($input{lat}, $input{lon}, 'G'); + mySociety::GeoUtil::wgs84_to_national_grid($input{lat}, $input{lon}, 'G'); } catch Error::Simple with { my $e = shift; push @errors, "We had a problem with the supplied co-ordinates - outside the UK?"; }; } - + my $fh = $q->upload('photo'); if ($fh) { my $err = Page::check_photo($q, $fh); |