Provide default ROOT_PATH for command-line scripts
Fix cookie domain for localhost

Web browsers don't appreciate a cookie domain without any dots. This patch
detects the originally-requested domain for the request. If the domain does
not contain dots (such as 'localhost' or the name of a local server on your
network defined in your hosts file), no cookie domain is sent.

The greatest symptom of this issue what the illustrious 'Invalid CSRF token'
seen repeatedly on the scp login page. The reason is that the browser was
rejecting the cookie from the server.

Fixes #677, #672, #653
Merge pull request #705 from greezybacon/issue/root-path-cli

Provide a fallback ROOT_PATH

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #708 from greezybacon/issue/mail-fetch-attachments

Fetch attachments in mail fetch
Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #709 from greezybacon/issue/localhost-login

Fix cookie domain for localhost

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge branch 'master' into develop

Conflicts:
	include/class.misc.php
Oops. No need to fetch attachments twice
HTML ticket thread and inline images
Process inline attachments in thread entry

and support inline images in piped emails
Support inline images across the system, with draft support
Migrate to a single attachment table

That way we don't need a new table for everything we need to attach an
inline image to (like a signature, for instance)
Add richtext support for internal notes
Implement images on site pages
Implement more features

* Image paste in Redactor
* Make non-local images optional
* Placeholder for non-local images
* Fix local image download hover
* Don't re-attach inline images