Only attempt email link sign-on if tokens exist

If the `view.php` page is requested and an auth token is not present in the
URL, do not attempt to sign the user on since it will always fail and will
result in a false "Failed login attempt" warning to the system log.
Once you are authorized, you should be authorized forever.
Merge pull request #765 from thegrandpoobah/fixrefreshbutton

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #763 from greezybacon/issue/unknown-user

Reviewed-By: Peter Rotich <peter@osticket.com>
file: Don't crash when sending data to file backends
Inline images in email without a 'cid:' indicator

It is the defacto standard to reference an inline image in an email by
referencing the Content-ID header of the referenced attachment in the @src
attribute of the image. For instance, `<imc src="cid:image001.png">` where
the `cid:` scheme of the attribute indicates that the referenced image URL
is a separate content of the email. The image attached to the email would
have an accompanying header like: `Content-Id: <image001.png>`. However,
some mail systems, including a certain fax to email service, do not
correctly indicate the location of the image with the content-id URL.
Instead, the referenced image tag would be `<img src="image001.png">`

This patch addresses the issue by searching the message body for all
references to attached content-id's in all @src attributes with or without
the content-id URL scheme indicator. Previously, such images would not be
displayed inline in the ticket thread.

References:
https://tools.ietf.org/html/rfc2392
Merge pull request #779 from greezybacon/issue/inline-img-missing-cid

Inline images in email without a 'cid:' indicator

Reviewed-By: Peter Rotich <peter@osticket.com>
Relax detection of images for strip detection

It is perfectectly fine to have an image cited in an HTML body similar to:

<img width=909 height=302 src=cid:image002.jpg@01CF5426.BF5A72A0 alt=image>

Which may or may not have quoted @src attribute, and may very well have an
at sign (@) somewhere in the attribute text. The previous regular expression
would not match such a @src attribute.
validation: Fixup a few email address validations
Fixup merging of email recipients

This stems from a confusing similarity between the + operator for arrays
and array_merge() in php. Adding arrays will ignore items in the RHS where
keys are present in the LHS. Therefore, when adding numerically indexed
arrays together, only items on the RHS that have a key higher than the
greatest key on the LHS will be included.
oops: Don't crash when sending fatal alert email
html: Avoid corrupting quoted style attributes

For instance, current this style we be converted as
```
<span style="font-family:'courier new';">
```
to
```
<span style="font-family:&quot;">
```

Also discard Microsoft Office specific style attributes such as `mso-list`
and friends
ui: Fixup unnecessary extra spacing in thread body
html: Trim space around `;` in @style attributes
Merge pull request #784 from greezybacon/issue/html-style-cleanup

html: Avoid corrupting quoted style attributes

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #785 from greezybacon/issue/thread-body-odd-styles

ui: Fixup unnecessary extra spacing in thread body

Reviewed-By: Peter Rotich <peter@osticket.com>
Clear settings on department deletion

Clear ticket routing settings on topic, email or filter tables on department
deletion.
Merge pull request #792 from protich/issue/cleardeptsetting

Clear settings on department deletion

Reviewed-By: Jared Hancock <jared@osticket.com>
Show more dropdown for users with edit permission

Users with edit permission should be able to change ticket owner in line.
Merge pull request #799 from protich/issue/change-owner

Show more drop down for users with edit permission

Reviewed-By: Jared Hancock <jared@osticket.com>