From b1ef06ac929b878163befb7effa54aa13d6426e5 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 24 Oct 2011 17:54:13 -0400 Subject: Bug 685552 - Email auto-completion causes server to thrash r/a=mkanat --- Bugzilla/Config/UserMatch.pm | 6 ++++++ Bugzilla/Mailer.pm | 2 ++ docs/en/xml/administration.xml | 7 ++++++- template/en/default/admin/params/usermatch.html.tmpl | 3 +++ template/en/default/global/userselect.html.tmpl | 4 ++-- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Config/UserMatch.pm b/Bugzilla/Config/UserMatch.pm index f97cfeab2..38d2cb05b 100644 --- a/Bugzilla/Config/UserMatch.pm +++ b/Bugzilla/Config/UserMatch.pm @@ -46,6 +46,12 @@ sub get_param_list { default => '0' }, + { + name => 'ajax_user_autocompletion', + type => 'b', + default => '1', + }, + { name => 'maxusermatches', type => 't', diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 699467ed8..f8d5e9556 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -171,6 +171,8 @@ sub MessageToMTA { Bugzilla::Hook::process('mailer_before_send', { email => $email, mailer_args => \@args }); + return if $email->header('to') eq ''; + if ($method eq "Test") { my $filename = bz_locations()->{'datadir'} . '/mailer.testfile'; open TESTFILE, '>>', $filename; diff --git a/docs/en/xml/administration.xml b/docs/en/xml/administration.xml index 3796c8caf..82d986791 100644 --- a/docs/en/xml/administration.xml +++ b/docs/en/xml/administration.xml @@ -864,7 +864,12 @@ contains parameters for how user names can be queried and matched when entered. - + + Another setting called 'ajax_user_autocompletion' enables certain + user fields to display a list of matched user names as a drop down after typing + a few characters. Note that it is recommended to use mod_perl when + enabling 'ajax_user_autocompletion'. + diff --git a/template/en/default/admin/params/usermatch.html.tmpl b/template/en/default/admin/params/usermatch.html.tmpl index 54f150900..d574edca7 100644 --- a/template/en/default/admin/params/usermatch.html.tmpl +++ b/template/en/default/admin/params/usermatch.html.tmpl @@ -29,6 +29,9 @@ "needs to be selected. This option should not be enabled on " _ "sites where there are a large number of users.", + ajax_user_autocompletion => "If this option is set, typing characters in a certain user " _ + "fields will display a list of matches that can be selected from.", + 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/userselect.html.tmpl b/template/en/default/global/userselect.html.tmpl index 600b21c13..1d0395043 100644 --- a/template/en/default/global/userselect.html.tmpl +++ b/template/en/default/global/userselect.html.tmpl @@ -79,7 +79,7 @@ [% END %] [% ELSE %] - [% IF id && feature_enabled('jsonrpc') %] + [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
[% END %] @@ -94,7 +94,7 @@ [% IF size %] size="[% size FILTER html %]" [% END %] [% IF id %] id="[% id FILTER html %]" [% END %] > - [% IF id && feature_enabled('jsonrpc') %] + [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]