From ffc663e11c9bd310e5a15452739dc64b88095611 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 31 Mar 2009 19:24:22 +0000 Subject: Bug 399089: Remove the 'usermatchmode' parameter - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Config/UserMatch.pm | 7 ------- Bugzilla/User.pm | 11 ++--------- template/en/default/admin/params/usermatch.html.tmpl | 6 ------ template/en/default/global/confirm-user-match.html.tmpl | 3 +-- 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/Bugzilla/Config/UserMatch.pm b/Bugzilla/Config/UserMatch.pm index 819247e99..9e19f1d2b 100644 --- a/Bugzilla/Config/UserMatch.pm +++ b/Bugzilla/Config/UserMatch.pm @@ -46,13 +46,6 @@ sub get_param_list { default => '0' }, - { - name => 'usermatchmode', - type => 's', - choices => ['off', 'wildcard', 'search'], - default => 'off' - }, - { name => 'maxusermatches', type => 't', diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index d373f019d..1e20ef73d 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1012,11 +1012,7 @@ sub match { # first try wildcards my $wildstr = $str; - 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') - { - + if ($wildstr =~ s/\*/\%/g) { # don't do wildcards if no '*' in the string # Build the query. trick_taint($wildstr); my $query = "SELECT DISTINCT login_name FROM profiles "; @@ -1054,10 +1050,7 @@ sub match { } # then try substring search - if ((scalar(@users) == 0) - && (Bugzilla->params->{'usermatchmode'} eq 'search') - && (length($str) >= 3)) - { + if (!scalar(@users) && length($str) >= 3) { trick_taint($str); my $query = "SELECT DISTINCT login_name FROM profiles "; diff --git a/template/en/default/admin/params/usermatch.html.tmpl b/template/en/default/admin/params/usermatch.html.tmpl index 178a72844..54f150900 100644 --- a/template/en/default/admin/params/usermatch.html.tmpl +++ b/template/en/default/admin/params/usermatch.html.tmpl @@ -29,12 +29,6 @@ "needs to be selected. This option should not be enabled on " _ "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}.

" _ - "'off' disables matching,
" _ - "'wildcard' allows only wildcards,
" _ - "and 'search' allows both wildcards and substring (freetext) matches.", - maxusermatches => "Search for no more than this many matches.
" _ "If set to '1', no users will be displayed on ambiguous matches. " _ "This is useful for user privacy purposes.
" _ diff --git a/template/en/default/global/confirm-user-match.html.tmpl b/template/en/default/global/confirm-user-match.html.tmpl index 5b209dfce..f961ee0b9 100644 --- a/template/en/default/global/confirm-user-match.html.tmpl +++ b/template/en/default/global/confirm-user-match.html.tmpl @@ -132,8 +132,7 @@ [% query.value.users.0.identity FILTER html %] [% END %] [% ELSE %] - [% IF (query.key.length < 3) && !(Param('emailsuffix')) - && (Param('usermatchmode') == 'search') %] + [% IF (query.key.length < 3) && !Param('emailsuffix') %] was too short for substring match (minimum 3 characters) [% ELSE %] -- cgit v1.2.3-24-g4f1b