let backgrounds be put under SSL

This commit is contained in:
Evan Prodromou 2010-02-11 17:03:31 -05:00
parent b96af33d97
commit 3018683718
3 changed files with 17 additions and 3 deletions

2
README
View File

@ -1521,6 +1521,8 @@ dir: directory to write backgrounds too. Default is '/background/'
subdir of install dir.
path: path to backgrounds. Default is sub-path of install path; note
that you may need to change this if you change site-path too.
ssl: Whether or not to use HTTPS for background files. Defaults to
null, meaning to guess from site-wide SSL settings.
ping
----

View File

@ -155,9 +155,20 @@ class Design extends Memcached_DataObject
$server = common_config('site', 'server');
}
// XXX: protocol
$ssl = common_config('background', 'ssl');
return 'http://'.$server.$path.$filename;
if (is_null($ssl)) { // null -> guess
if (common_config('site', 'ssl') == 'always' &&
!common_config('background', 'server')) {
$ssl = true;
} else {
$ssl = false;
}
}
$protocol = ($ssl) ? 'https' : 'http';
return $protocol.'://'.$server.$path.$filename;
}
function setDisposition($on, $off, $tile)

View File

@ -116,7 +116,8 @@ $default =
'background' =>
array('server' => null,
'dir' => INSTALLDIR . '/background/',
'path' => $_path . '/background/'),
'path' => $_path . '/background/',
'ssl' => null),
'public' =>
array('localonly' => true,
'blacklist' => array(),