diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-02-01 07:18:23 +0100 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-02-01 07:18:23 +0100 |
commit | 0bec0fc5fb5bfb02a80c6a84581d9daeb9f17813 (patch) | |
tree | 26afc64e0e9f7b1b240798bc457d4aa3c5fe5614 /boot.php | |
parent | e7d87e4ab3086b7cc10e92bfee769179f80a4d0d (diff) | |
parent | 7dbdf8e6faf082e962772b76511f0fd24b6227cc (diff) | |
download | volse-hubzilla-0bec0fc5fb5bfb02a80c6a84581d9daeb9f17813.tar.gz volse-hubzilla-0bec0fc5fb5bfb02a80c6a84581d9daeb9f17813.tar.bz2 volse-hubzilla-0bec0fc5fb5bfb02a80c6a84581d9daeb9f17813.zip |
Merge branch 'friendika-master'
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'BUILD_ID', 1033 ); +define ( 'BUILD_ID', 1034 ); define ( 'FRIENDIKA_VERSION', '2.10.0902' ); define ( 'DFRN_PROTOCOL_VERSION', '2.0' ); @@ -10,6 +10,16 @@ define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'DOWN_ARROW', '⇩' ); + +/** + * SSL redirection policies + */ + +define ( 'SSL_POLICY_NONE', 0 ); +define ( 'SSL_POLICY_FULL', 1 ); +define ( 'SSL_POLICY_SELFSIGN', 2 ); + + /** * log levels */ @@ -270,10 +280,17 @@ class App { } function get_baseurl($ssl = false) { - if(strlen($this->baseurl)) - return $this->baseurl; - $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); + $scheme = $this->scheme; + + if(x($this->config,'ssl_policy')) { + if(($ssl) || ($this->config['ssl_policy'] == SSL_POLICY_FULL)) + $scheme = 'https'; + if(($this->config['ssl_policy'] == SSL_POLICY_SELFSIGN) && (local_user() || x($_POST,'auth-params'))) + $scheme = 'https'; + } + + $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); return $this->baseurl; } |