| version 1.54, 2012/10/09 12:35:23 |
version 1.55, 2013/06/24 09:38:11 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/subst.inc.php,v 1.53 2012-09-28 18:49:48 nepto Exp $ */ |
/* $Platon: Metafox/subst.inc.php,v 1.54 2012-10-09 12:35:23 igor Exp $ */ |
| |
|
| require_once 'cfgldr.inc.php'; |
require_once 'cfgldr.inc.php'; |
| require_once 'error.inc.php'; |
require_once 'error.inc.php'; |
| Line 50 ezin_cgi_parse(); |
|
| Line 50 ezin_cgi_parse(); |
|
| * Mandatory HTTP host check |
* Mandatory HTTP host check |
| */ |
*/ |
| |
|
| |
switch ($ezin_cfg['https_admin']) { |
| |
case 0: // Always OFF |
| |
$https_admin_redirect = false; |
| |
break; |
| |
case 1: // Auto-detect |
| |
$https_admin_redirect = strcasecmp($_SERVER['HTTPS'], 'on') |
| |
&& strlen($_SERVER['HTTP_HOST']) > 0; |
| |
break; |
| |
case 2: // Always ON |
| |
$https_admin_redirect = true; |
| |
break; |
| |
} |
| |
|
| if ($ezin_cgi['output'] == 'admin' |
if ($ezin_cgi['output'] == 'admin' |
| && strcasecmp($_SERVER['HTTPS'], 'on') |
&& $https_admin_redirect) |
| && strlen($_SERVER['HTTP_HOST']) > 0) { |
{ |
| $socket = @fsockopen('ssl://'.$_SERVER['HTTP_HOST'], 443); |
$socket = @fsockopen('ssl://'.$_SERVER['HTTP_HOST'], 443); |
| if (is_resource($socket)) { |
if (is_resource($socket)) { |
| $req_str = "HEAD / HTTP/1.1\r\n"; |
$req_str = "HEAD / HTTP/1.1\r\n"; |