Changeset 2102
- Timestamp:
- 08/04/2007 11:21:24 AM
- Files:
-
- trunk/framework/Web/THttpRequest.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/framework/Web/THttpRequest.php
r2002 r2102 111 111 private $_requestResolved=false; 112 112 private $_enableCookieValidation=false; 113 private $_forceSecureConnection=null; 113 114 /** 114 115 * @var string request URL … … 321 322 } 322 323 324 public function setForceSecureConnection($value) 325 { 326 $this->_forceSecureConnection=TPropertyValue::ensureBoolean($value); 327 } 328 329 public function getForceSecureConnection() 330 { 331 return $this->_forceSecureConnection; 332 } 333 323 334 /** 324 335 * @return boolean if the request is sent via secure channel (https) … … 326 337 public function getIsSecureConnection() 327 338 { 328 return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off');339 return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off'); 329 340 } 330 341 … … 358 369 public function getBaseUrl() 359 370 { 360 return ($this->getIsSecureConnection() ? "https://" : "http://") . $_SERVER ['HTTP_HOST'];371 return ($this->getIsSecureConnection() || $this->getForceSecureConnection() ? "https://" : "http://") . $_SERVER ['HTTP_HOST']; 361 372 } 362 373 … … 546 557 { 547 558 $url=$this->_urlManager->constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems); 559 if($this->getForceSecureConnection()!==null) 560 $url = $this->getBaseUrl().$url; 548 561 if(defined('SID') && SID != '' && !$this->_cookieOnly) 549 562 return $url . (strpos($url,'?')===false? '?' : ($encodeAmpersand?'&':'&')) . SID;
