git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@670 a333f486-631f-4898-b8df-5754b55c2be0
@@ -194,8 +194,7 @@ EOF
static function SecureConnectionRequired()
{
- $oConfig = new Config(ITOP_CONFIG_FILE);
- return $oConfig->GetSecureConnectionRequired();
+ return utils::GetConfig()->GetSecureConnectionRequired();
}
static function IsConnectionSecure()
@@ -185,6 +185,11 @@ class utils
// Build an absolute URL to this page on this server/port
$sServerName = $_SERVER['SERVER_NAME'];
+ if (self::GetConfig()->GetSecureConnectionRequired())
+ {
+ // If a secure connection is required, then any URL must start with https !
+ $bForceHTTPS = true;
+ }
if ($bForceHTTPS)
$sProtocol = 'https';