瀏覽代碼

#286 Issue with HTTPS - reviewed the fix implemented in [896]

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@931 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父節點
當前提交
d66cba8756

+ 1 - 1
application/loginwebpage.class.inc.php

@@ -201,7 +201,7 @@ EOF
 	{
 		$bSecured = false;
 
-		if ( !empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!= 'off') )
+		if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off'))
 		{
 			$bSecured = true;
 		}

+ 3 - 3
pages/opensearch.xml.php

@@ -23,9 +23,9 @@
  * @license     http://www.opensource.org/licenses/gpl-3.0.html LGPL
  */
 
-	$sFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/UI.php';
-	$sICOFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.ico';
-	$sPNGFullUrl = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.png';
+	$sFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/UI.php';
+	$sICOFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.ico';
+	$sPNGFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.png';
 	header('Content-type: text/xml');
 ?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">

+ 1 - 1
test/testlist.inc.php

@@ -1873,7 +1873,7 @@ class TestSoap extends TestSoapWebService
 		global $aSOAPMapping;
 
 		// this file is generated dynamically with location = here
-		$sWsdlUri = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php';
+		$sWsdlUri = 'http'.(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off') ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php';
 
 		ini_set("soap.wsdl_cache_enabled","0");
 		$this->m_SoapClient = new SoapClient

+ 1 - 1
webservices/itop.wsdl.php

@@ -33,7 +33,7 @@ $sMyWsdl = './itop.wsdl.tpl';
 
 $sRawFile = file_get_contents($sMyWsdl);
 
-$sServerURI = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php';
+$sServerURI = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php';
 
 $sFinalFile = str_replace(
 	'___SOAP_SERVER_URI___',

+ 1 - 1
webservices/itopsoap.examples.php

@@ -26,7 +26,7 @@
 
 require_once('itopsoaptypes.class.inc.php');
 
-$sItopRoot = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..';
+$sItopRoot = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..';
 $sWsdlUri = $sItopRoot.'/webservices/itop.wsdl.php';
 
 ini_set("soap.wsdl_cache_enabled","0");

+ 1 - 1
webservices/soapserver.php

@@ -32,7 +32,7 @@ require_once('../application/startup.inc.php');
 require('./webservices.class.inc.php');
 
 // this file is generated dynamically with location = here
-$sWsdlUri = 'http'.((empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php';
+$sWsdlUri = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php';
 
 
 ini_set("soap.wsdl_cache_enabled","0");