Add detection for PHP running in CGI mode and add HTTP_AUTHORIZATION rewrite rule

When PHP is running under CGI mode in Apache, the basic authentication variables ```$_SERVER['PHP_AUTH_USER']``` and ```$_SERVER['PHP_AUTH_PW']``` do not get populated.
This workaround sets ```$_SERVER['HTTP_AUTHORIZATION']``` which contains ```PHP_AUTH_USER``` and ```PHP_AUTH_PW``` in a base64 encoded string that parsed by ```security/BasicAuth.php```