Commit ffc663e1 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 399089: Remove the 'usermatchmode' parameter - Patch by Fré©ric Buclin…

Bug 399089: Remove the 'usermatchmode' parameter - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent d8dc06a6
...@@ -47,13 +47,6 @@ sub get_param_list { ...@@ -47,13 +47,6 @@ sub get_param_list {
}, },
{ {
name => 'usermatchmode',
type => 's',
choices => ['off', 'wildcard', 'search'],
default => 'off'
},
{
name => 'maxusermatches', name => 'maxusermatches',
type => 't', type => 't',
default => '1000', default => '1000',
......
...@@ -1012,11 +1012,7 @@ sub match { ...@@ -1012,11 +1012,7 @@ sub match {
# first try wildcards # first try wildcards
my $wildstr = $str; my $wildstr = $str;
if ($wildstr =~ s/\*/\%/g # don't do wildcards if no '*' in the string if ($wildstr =~ s/\*/\%/g) { # don't do wildcards if no '*' in the string
# or if we only want exact matches
&& Bugzilla->params->{'usermatchmode'} ne 'off')
{
# Build the query. # Build the query.
trick_taint($wildstr); trick_taint($wildstr);
my $query = "SELECT DISTINCT login_name FROM profiles "; my $query = "SELECT DISTINCT login_name FROM profiles ";
...@@ -1054,10 +1050,7 @@ sub match { ...@@ -1054,10 +1050,7 @@ sub match {
} }
# then try substring search # then try substring search
if ((scalar(@users) == 0) if (!scalar(@users) && length($str) >= 3) {
&& (Bugzilla->params->{'usermatchmode'} eq 'search')
&& (length($str) >= 3))
{
trick_taint($str); trick_taint($str);
my $query = "SELECT DISTINCT login_name FROM profiles "; my $query = "SELECT DISTINCT login_name FROM profiles ";
......
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
"needs to be selected. This option should not be enabled on " _ "needs to be selected. This option should not be enabled on " _
"sites where there are a large number of users.", "sites where there are a large number of users.",
usermatchmode => "Allow match strings to be entered for user names when entering " _
"and editing ${terms.bugs}.<p> " _
"'off' disables matching,<br> " _
"'wildcard' allows only wildcards,<br> " _
"and 'search' allows both wildcards and substring (freetext) matches.",
maxusermatches => "Search for no more than this many matches.<br> " _ maxusermatches => "Search for no more than this many matches.<br> " _
"If set to '1', no users will be displayed on ambiguous matches. " _ "If set to '1', no users will be displayed on ambiguous matches. " _
"This is useful for user privacy purposes.<br> " _ "This is useful for user privacy purposes.<br> " _
......
...@@ -132,8 +132,7 @@ ...@@ -132,8 +132,7 @@
<b>[% query.value.users.0.identity FILTER html %]</b> <b>[% query.value.users.0.identity FILTER html %]</b>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% IF (query.key.length < 3) && !(Param('emailsuffix')) [% IF (query.key.length < 3) && !Param('emailsuffix') %]
&& (Param('usermatchmode') == 'search') %]
<font color="#FF0000">was too short for substring match <font color="#FF0000">was too short for substring match
(minimum 3 characters)</font> (minimum 3 characters)</font>
[% ELSE %] [% ELSE %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment