Commit b1ef06ac authored by David Lawrence's avatar David Lawrence

Bug 685552 - Email auto-completion causes server to thrash

r/a=mkanat
parent 650a2f9f
...@@ -47,6 +47,12 @@ sub get_param_list { ...@@ -47,6 +47,12 @@ sub get_param_list {
}, },
{ {
name => 'ajax_user_autocompletion',
type => 'b',
default => '1',
},
{
name => 'maxusermatches', name => 'maxusermatches',
type => 't', type => 't',
default => '1000', default => '1000',
......
...@@ -171,6 +171,8 @@ sub MessageToMTA { ...@@ -171,6 +171,8 @@ sub MessageToMTA {
Bugzilla::Hook::process('mailer_before_send', Bugzilla::Hook::process('mailer_before_send',
{ email => $email, mailer_args => \@args }); { email => $email, mailer_args => \@args });
return if $email->header('to') eq '';
if ($method eq "Test") { if ($method eq "Test") {
my $filename = bz_locations()->{'datadir'} . '/mailer.testfile'; my $filename = bz_locations()->{'datadir'} . '/mailer.testfile';
open TESTFILE, '>>', $filename; open TESTFILE, '>>', $filename;
......
...@@ -864,7 +864,12 @@ ...@@ -864,7 +864,12 @@
contains parameters for how user names can be queried and matched contains parameters for how user names can be queried and matched
when entered. when entered.
</para> </para>
<para>
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'.
</para>
</section> </section>
</section> </section>
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
"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.",
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.<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> " _
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
[% END %] [% END %]
</select> </select>
[% ELSE %] [% ELSE %]
[% IF id && feature_enabled('jsonrpc') %] [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
<div id="[% id FILTER html %]_autocomplete" <div id="[% id FILTER html %]_autocomplete"
[% IF classes %] class="[% classes.join(' ') FILTER html %]" [% END %]> [% IF classes %] class="[% classes.join(' ') FILTER html %]" [% END %]>
[% END %] [% END %]
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
[% IF size %] size="[% size FILTER html %]" [% END %] [% IF size %] size="[% size FILTER html %]" [% END %]
[% IF id %] id="[% id FILTER html %]" [% END %] [% IF id %] id="[% id FILTER html %]" [% END %]
> >
[% IF id && feature_enabled('jsonrpc') %] [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
<div id="[% id FILTER html %]_autocomplete_container"></div> <div id="[% id FILTER html %]_autocomplete_container"></div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
......
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