diff options
author | Sarven Capadisli <csarven@status.net> | 2010-02-13 20:28:39 +0100 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-02-13 20:28:39 +0100 |
commit | 9465a4d5c6b77bd77e78bc277a817e2b5724ec76 (patch) | |
tree | 8533ad32339160d5ba3cf27209f78740ffa977cd /lib | |
parent | 171bf3093a4cf3f3ff0b4d255392ffd5375e4c36 (diff) | |
parent | 269b4711eb1600597af314f2fdca00102ff5566a (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.php | 13 | ||||
-rw-r--r-- | lib/htmloutputter.php | 15 | ||||
-rw-r--r-- | lib/theme.php | 15 |
3 files changed, 35 insertions, 8 deletions
diff --git a/lib/default.php b/lib/default.php index bf4b83718..8b1fe2769 100644 --- a/lib/default.php +++ b/lib/default.php @@ -111,11 +111,13 @@ $default = 'avatar' => array('server' => null, 'dir' => INSTALLDIR . '/avatar/', - 'path' => $_path . '/avatar/'), + 'path' => $_path . '/avatar/', + 'ssl' => null), 'background' => array('server' => null, 'dir' => INSTALLDIR . '/background/', - 'path' => $_path . '/background/'), + 'path' => $_path . '/background/', + 'ssl' => null), 'public' => array('localonly' => true, 'blacklist' => array(), @@ -123,10 +125,12 @@ $default = 'theme' => array('server' => null, 'dir' => null, - 'path'=> null), + 'path'=> null, + 'ssl' => null), 'javascript' => array('server' => null, - 'path'=> null), + 'path'=> null, + 'ssl' => null), 'throttle' => array('enabled' => false, // whether to throttle edits; false by default 'count' => 20, // number of allowed messages in timespan @@ -184,6 +188,7 @@ $default = array('server' => null, 'dir' => INSTALLDIR . '/file/', 'path' => $_path . '/file/', + 'ssl' => null, 'supported' => array('image/png', 'image/jpeg', 'image/gif', diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 317f5ea61..47e56fc8f 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -376,9 +376,20 @@ class HTMLOutputter extends XMLOutputter $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('javascript', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('javascript', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; - $src = 'http://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; + $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION; } $this->element('script', array('type' => $type, diff --git a/lib/theme.php b/lib/theme.php index 020ce1ac4..0be8c3b9d 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -110,9 +110,20 @@ class Theme $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('theme', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('theme', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; - $this->path = 'http://'.$server.$path.$name; + $this->path = $protocol . '://'.$server.$path.$name; } } |