Changeset 2102

Show
Ignore:
Timestamp:
08/04/2007 11:21:24 AM
Author:
carl
Message:

Fixed #672

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/framework/Web/THttpRequest.php

    r2002 r2102  
    111111        private $_requestResolved=false; 
    112112        private $_enableCookieValidation=false; 
     113        private $_forceSecureConnection=null; 
    113114        /** 
    114115         * @var string request URL 
     
    321322        } 
    322323 
     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 
    323334        /** 
    324335         * @return boolean if the request is sent via secure channel (https) 
     
    326337        public function getIsSecureConnection() 
    327338        { 
    328                return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off'); 
     339            return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off'); 
    329340        } 
    330341 
     
    358369        public function getBaseUrl() 
    359370        { 
    360                 return ($this->getIsSecureConnection() ? "https://" : "http://") . $_SERVER ['HTTP_HOST']; 
     371                return ($this->getIsSecureConnection() || $this->getForceSecureConnection() ? "https://" : "http://") . $_SERVER ['HTTP_HOST']; 
    361372        } 
    362373 
     
    546557        { 
    547558                $url=$this->_urlManager->constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems); 
     559                if($this->getForceSecureConnection()!==null) 
     560                    $url = $this->getBaseUrl().$url; 
    548561                if(defined('SID') && SID != '' && !$this->_cookieOnly) 
    549562                        return $url . (strpos($url,'?')===false? '?' : ($encodeAmpersand?'&':'&')) . SID;