Fix filter issue where negative logic prevents matches

The quickList() method will attempt to ask the database to find filters that
might match the incoming ticket information. The idea is that MySQL is
likely faster than PHP. The problem is that it assumes positive logic is
being utilized.

This patch adds all filters with at least one rule with dn_contain
(does-not-contain) or not_equal (not-equal)
Merge pull request #839 from greezybacon/issue/838

Fix filter issue where negative logic prevents matches

Reviewed-By: Peter Rotich <peter@osticket.com>
email: Handle poorly encoded email headers

Handle cases where email headers contain unicode or high-ascii characters
and are not encoded according to RFC-2047. This patch handles a special case
where a detectable unicode character set is used, such as UTF-8. For
high-ascii characters in a character set other than iso-8859-1, the result
of this patch is undefined.

Fixes #826
Properly handle htmlchars in web-based posts
Merge pull request #850 from greezybacon/issue/826

email: Handle poorly encoded email headers

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #851 from greezybacon/issue/htmlchars

Properly handle htmlchars in web-based posts

Reviewed-By: Peter Rotich <peter@osticket.com>
api: Add example script to create tickets
Merge pull request #852 from greezybacon/feature/api-example-script

api: Add example script to create tickets

Reviewed-By: Peter Rotich <peter@osticket.com>
email: Accept inline body with disposition params

A mail client may indicate a header parameter (such as Novell Groupwise,
which may add something like

Content-Disposition: inline; modification-time: "Thu ..."

) Previously, the system would not consider the content to be a candidate
for the email body, because it has parameters to the content-disposition
header.

This patch will still consider the part to be a candidate for the body if
the mime types match and no filename is found in the content-disposition
parameters.
Merge pull request #853 from greezybacon/issue/inline-body-with-disposition-params

email: Accept inline body with disposition params

Reviewed-By: Peter Rotich <peter@osticket.com>
bux fix for custom upgrade streams

line 199: in case of custom upgrade streams, variable $signature contains the last value from the foreach cycle at line 130, not the core schema signature!

line 209: if we do not insert schema signatures for each custom stream, after install osTicket thinks it needs an upgrade and gets stuck (see function isUpgradePending() in class.ticket)
auth: Handle REQUEST_URI not being authoritative

If _SERVER{REQUEST_URI} does not start with a leading slash, add one. This
will ensure that the redirect URL offered after a successful login will
be to an absolute url rather than an implied relative one.

Fixes osTicket/osTicket-1.7#858
Faster SQL-query, huge performance improvement on installations with thousands of tickets.
perf: Slight simplification of SQL tweak

'where 1' and 'where 1=1' gives me hives...
Merge pull request #861 from greezybacon/issue/858

auth: Handle REQUEST_URI not being authoritative

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #862 from greezybacon/issue/856

perf: Significant improvement fetching statistics

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #854 from alpianon/patch-1

bug fix for custom upgrade streams

Reviewed-By: Jared Hancock <jared@osticket.com>
mysqli: Allow specification of a unix socket

This patch allows for the specification of a socket in the database hostname
field, such as localhost:/path/to/mysql.sock
Merge pull request #864 from greezybacon/issue/mysqli-local-socket

mysqli: Allow specification of a unix socket

Reviewed-By: Peter Rotich <peter@osticket.com>