Change getenv('HTTPS') to $_SERVER['HTTPS']

Checking also connection port as on some environments $_SERVER['HTTPS'] can be empty
What do you think of the following?
```php
if ( (ENABLE_SSL == true) && ($request_type == 'SSL') ) {
```
(with $request_type set as a global in the function)