Bug 191 - Support https protocol.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1564 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2005-11-06 21:21:35 +00:00
parent 8ed3a1d69d
commit c26c477420
2 changed files with 11 additions and 1 deletions

View File

@ -49,6 +49,16 @@ if ( !isset($PHP_SELF) )
$PHP_SELF = $_SERVER['PHP_SELF']; $PHP_SELF = $_SERVER['PHP_SELF'];
} }
if ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' )
{
$protocol = 'https';
}
else
{
$protocol = 'http';
}
define( "ZM_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] );
if ( empty($format) ) if ( empty($format) )
{ {
$wurfl_file = "./wurfl_class.php"; $wurfl_file = "./wurfl_class.php";

View File

@ -118,7 +118,7 @@ function getStreamSrc( $args )
global $_SESSION, $_SERVER; global $_SESSION, $_SERVER;
} }
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS; $stream_src = ZM_URL.ZM_PATH_ZMS;
if ( ZM_OPT_USE_AUTH ) if ( ZM_OPT_USE_AUTH )
{ {