Fixes #16849: Drop FTP support.
Fix #16880: regression introduced by original patch
Fix #16880: another one
Prevent plugin pages access when upgrade pending

If a plugin's code has been upgraded, but the schema is still on the old
version, the plugin is effectively disabled (i.e. its entry points are
not displayed). However, it was still possible to access individual
pages directly, which could lead to errors.

This commit adds an extra check in plugin.php which triggers an error
when the plugin needs to be upgraded.

Fixes #16706
Fix group actions not sending notifications

Added missing email_generic() calls

Fixes #6343, #13659
Dropping deprecated database API function db_query()

Following recent commits [1] db_query() is no longer used in MantisBT.

Considering that the function is marked as deprecated since 1.2.0a2
(April 2008), it is time to effectively remove it.

Fixes #16898

[1] 3be86ce37bb469b211663da03f61ac2b28500d91, 7d76827617e97d7356e7eb4f2f66736e4c4d41b0, cf596c27b2a2e2aac67749b546cece9c23b4bbb1 and 0db530a855f92752aaa4bcf355df3ecba9af8226
Fix error with PostgreSQL when filtering on date custom field

As PostreSQL tries to add 0 to a string, it throws an error as it tries
to operate on different data types.

I can only guess that the +0 was a hack to convert type from string to
integer on MySQL.

Implementing solution proposed by user kensonman, using standard SQL
functions CAST, COALESCE and NULLIF to achieve a clean and portable
conversion to numeric (this assumes that the data stored in the
custom_fields_string table 'value' column is indeed numeric; if not we
would get other errors or warnings)

Note: this requires bumping MySQL minimum requirement to 5.08, since
DECIMAL type used in CAST was only added in that release.

Fixes #16584
Use variable to minimize array dereferencing
Install: bump minimum MySQL version

MySQL 5.08 is required due to use of CAST to DECIMAL type.

http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast.
Add constants for minimum DB versions supported
Install: use DB minimum versions constants
PostgreSQL: fix issue with date filters on custom fields

Pull request 125
Proper detection of path for admin checks
Admin checks: use standard html API calls
Admin checks: Simplify code to generate verbosity links
Define reference variables for database checks
Whitespace
Admin check: minimum RDBMS version
Admin check: reword ADOdb extension warning message
Admin check: MySQL database