diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 10 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/FakeMapit.pm | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 424f68ba3..6264d1a73 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -961,6 +961,11 @@ sub user_add : Path('user_edit') : Args(0) { $c->forward('check_token'); + if ( $c->cobrand->moniker eq 'zurich' and $c->req->param('email') eq '' ) { + $c->stash->{field_errors}->{email} = _('The email field is required'); + return 1; + } + return unless $c->req->param('name') && $c->req->param('email'); my $user = $c->model('DB::User')->find_or_create( { @@ -1008,6 +1013,11 @@ sub user_edit : Path('user_edit') : Args(1) { $user->email( $c->req->param('email') ); $user->from_body( $c->req->param('body') || undef ); $user->flagged( $c->req->param('flagged') || 0 ); + + if ( $c->cobrand->moniker eq 'zurich' and $user->email eq '' ) { + $c->stash->{field_errors}->{email} = _('The email field is required'); + return 1; + } $user->update; if ($edited) { diff --git a/perllib/FixMyStreet/App/Controller/FakeMapit.pm b/perllib/FixMyStreet/App/Controller/FakeMapit.pm index bc46df712..253c75ba4 100755 --- a/perllib/FixMyStreet/App/Controller/FakeMapit.pm +++ b/perllib/FixMyStreet/App/Controller/FakeMapit.pm @@ -12,13 +12,13 @@ FixMyStreet::App::Controller::FakeMapit - Catalyst Controller A controller to fake mapit when we don't have it. If you set MAPIT_URL to .../fakemapit/ it should all just work, with a mapit that assumes the whole -world is one area, with ID 161 and name "Default Area". +world is one area, with ID 161 and name "Everywhere". =head1 METHODS =cut -my $area = { "name" => "Default Area", "type" => "ZZZ", "id" => 161 }; +my $area = { "name" => "Everywhere", "type" => "ZZZ", "id" => 161 }; sub output : Private { my ( $self, $c, $data ) = @_; |