aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm22
1 files changed, 14 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index a61032988..9a6c7bded 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -1076,16 +1076,18 @@ sub user_add : Path('user_edit') : Args(0) {
$c->forward('get_token');
$c->forward('fetch_all_bodies');
- return 1 unless $c->get_param('submit');
+ return unless $c->get_param('submit');
$c->forward('check_token');
- if ( $c->cobrand->moniker eq 'zurich' and $c->get_param('email') eq '' ) {
+ unless ($c->get_param('email')) {
$c->stash->{field_errors}->{email} = _('Please enter a valid email');
- return 1;
+ return;
+ }
+ unless ($c->get_param('name')) {
+ $c->stash->{field_errors}->{name} = _('Please enter a name');
+ return;
}
-
- return unless $c->get_param('name') && $c->get_param('email');
my $user = $c->model('DB::User')->find_or_create( {
name => $c->get_param('name'),
@@ -1133,12 +1135,16 @@ sub user_edit : Path('user_edit') : Args(1) {
$user->from_body( $c->get_param('body') || undef );
$user->flagged( $c->get_param('flagged') || 0 );
- if ( $c->cobrand->moniker eq 'zurich' and $user->email eq '' ) {
+ unless ($user->email) {
$c->stash->{field_errors}->{email} = _('Please enter a valid email');
- return 1;
+ return;
+ }
+ unless ($user->name) {
+ $c->stash->{field_errors}->{name} = _('Please enter a name');
+ return;
}
- $user->update;
+ $user->update;
if ($edited) {
$c->forward( 'log_edit', [ $id, 'user', 'edit' ] );
}
Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<html>
  <body>
    <style>
.switchname {
	position: absolute;
	font-family: sans-serif;
	font-size: small;
	white-space: nowrap;
}
.rot {
	-webkit-transform: rotate(-90deg);
	-webkit-transform-origin: 0% 0%;
	transform: rotate(-90deg);
	transform-origin: 0% 0%;
	bottom: -14px;
}
</style>
    <p id="playground">
      <svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
      </svg>
      <img src="tg14-salkart.png" alt="" id="map" />
    </p>
    <script type="text/javascript" src="ping.js"></script>
  </body>
</html>