diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-29 15:21:00 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-29 15:24:28 +0000 |
commit | fe26614bc604bcb7111b075381fc1e4992764306 (patch) | |
tree | 5fad9523858f588c5869a5b32507acd3751fe4fb /perllib/FixMyStreet/App/Controller/Admin.pm | |
parent | 7cb9ebe6fdc2b41911bc37e4f1c1c346b2ff4ec2 (diff) |
Allow searching for <email> in admin.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 188d8c98c..acd6ddbf2 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -684,6 +684,14 @@ sub reports : Path('reports') { if (my $search = $c->get_param('search')) { $search = $self->trim($search); + + # In case an email address, wrapped in <...> + if ($search =~ /^<(.*)>$/) { + my $possible_email = $1; + my $parsed = FixMyStreet::SMS->parse_username($possible_email); + $search = $possible_email if $parsed->{email}; + } + $c->stash->{searched} = $search; my $search_n = 0; @@ -1289,6 +1297,7 @@ sub users: Path('users') : Args(0) { if (my $search = $c->get_param('search')) { $search = $self->trim($search); + $search =~ s/^<(.*)>$/$1/; # In case email wrapped in <...> $c->stash->{searched} = $search; my $isearch = '%' . $search . '%'; |