Allow RT::Users->WhoBelongToGroups to optionally return unprivileged users

The WhoBelongToGroups filter should really not apply LimitToPrivileged at
all, but we can't remove it without breaking security assumptions elsewhere
in RT or in 3rd party code. So a new option IncludeUnprivileged is added, a
boolean that defaults to false. It can be set to true to disable the
LimitToPrivileged filter.

The documentation of the method is amended to explain that it filters out
unprivileged members by default.
Work around bugs in name resolution in SphinxSE on MySQL 5.5

No existant version of SphinxSE is currently capable of resolving
hostnames in CONNECTION= strings on MySQL 5.5.  As such, default to
127.0.0.1 when configuring the SphinxSE table on MySQL 5.5 or above.
See http://sphinxsearch.com/bugs/view.php?id=1815
Default to 127.0.0.1 in tests to work on MySQL 5.5
new callback AfterAttachments
Stop leaking an extra dbh during server startup

RT::Handle->CheckIntegrity is called during rt-server startup, and its
return value is is stored in $integrity.  Additionally, $RT::Handle is
explicitly destroyed, to ensure that the database is disconnected before
forking.

Unfortunately, this replies on the dbh going out of scope, and
disconnecting during its DESTROY.  As the dbh is stored in the
$integrity variable in addition to $RT::Handle->dbh, it never goes out
of scope, and is thus never disconnected.  For fastcgi deployments, this
causes every fastcgi process to hold open an extra database handle;
standalone servers only ever gain one extra handle.

As no callsite of CheckIntegrity relies on the $dbh return value, simply
return true.  This allows the database handle to be disconnected using
$RT::Handle->dbh(undef).
Explicitly disconnect the dbh before forking, if it exists

This remoes the reliance on disconnect-on-DESTROY, and ensures that the
database handle is disconnected even if outstanding references to
$RT::Handle->dbh still exist.
Don't search both Queue and Ticket CFs when passed a Queue.

In e2c21b55 (new in 4.2) we began calculating LookupType from the
ContextObj set in bb24a9f4 (back in 4.0).  This resulted in a LookupType
of RT::Queue if you said:

    $cf->LoadByName( Name => 'foo', Queue => 'General' );

because the ContextObj was set to General and then used to calculate a
LookupType.

Then we call LimitToQueue which force-applies a LookupType of
RT::Queue-RT::Ticket, meaning that we now search for:

    (main.LookupType IN ('RT::Queue') OR main.LookupType = 'RT::Queue-RT::Ticket')

This enforces the backwards compatible 'intended' change that

    $cf->LoadByName( Name => 'foo', Queue => 'General' );

searches for a ticket CF applied to the General queue and named foo.
Current 4.2 would also find a foo Queue CF applied to General.

This is seen best by code using RT::Queue->CustomField to load a
specific Custom Field applied to a Queue (but not globally).  This
commit also fixes those docs because they could confusingly lead you to
believe that $Queue->CustomField('foo') would get you the Queue custom
field named foo.  It has always retrieved the Ticket CF dating back to
the original CF implementation, but the docs were never updated when we
began allowing Custom Fields on Queues.

If you want a Queue's Foo CF you need to call

    $cf->LoadByName( Name => 'foo', Queue => 'General', LookupType => 'RT::Queue' );
Bump Symbol::Global::Name dep for 5.19.3 and above

That release includes the equivalent of ed759dbe; we include it
contengently so that other perl versions do not have an unnecessary
version bump in a stable series.
Very rough pass to bring RT::StyleGuide up to date

RT::StyleGuide has become very much dated with respect to RT's current
development practices.  Prune the worst of the conflicting advice from
it, and point to hacking.pod for a more recent take.
Always append an extra delimeter for multiple autocompletes

This hints at the delimeter, in the case of email autocomplete, for
instance.
Explain --no-users and --no-groups in more detail
I#28784: Tests for non-ASCII character in password

Reproduce the following error:

  Wide character in subroutine entry at lib/RT/User.pm line 1002.
I#28784: Handle non-ASCII character in passwod

The md5 method expects a sequence of bytes.
win32 is not a supported platform; remove remaining incidental mentions of it

The mention of Win32::Locale::Lexicon remains, because
I18N::LangTags::Detect version 1.04 and below (i.e. perl prior to
5.14.0) generates "used only once" warnings without it.
Add POD for rt-validate-aliases
Update tests to reflect API consistent with ticket links

Also expand test coverage to handle additional failure cases.
Update article URI API to be consistent with ticket URI API

Previously the article implementation of LocalURIPrefix added
/article/ to the returned prefix where the ticket version
implemented in fsck_com_rt.pm did not add /ticket/ in
LocalURIPrefix but rather in URIForObject. LocalURIPrefix is
largely an internal method used by URIForObject, however
rt-validator uses it when fixing links for Organization
changes. Make the APIs consistent to avoid special case code
elsewhere.
Warn if we parse an id but can't load the article
Move article object validation to cover entire method

Add a check on the $article object to the end of the method to
catch the case where Organization may have changed. Previously
this would result in a "Can't call method "Id" on an undefined
value" warning.
Merge branch '4.0/non-ascii-password' into 4.0-trunk