diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-05-18 12:12:40 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-05-18 12:12:40 -0400 |
commit | 83f0807e59b5be288374a825d1e4f75869d515de (patch) | |
tree | 8f3226d74c76d736564e0c6ed9e97f6d0388126c /mod/photo.php | |
parent | c024c17b5f7253432e9c53aa642f003b537f6b6b (diff) | |
parent | 38217444502aee41d71d90c0c8927999bb1b12e6 (diff) | |
download | volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.tar.gz volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.tar.bz2 volse-hubzilla-83f0807e59b5be288374a825d1e4f75869d515de.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
apply max-width to images in posts, duepuntozero
theming for default group selector
catch more places to apply default group
make it difficult to setup a private forum with no privacy
more private forums, default privacy group for new contacts
tell browser not to cache permission denied (private) photos so that after authenticating we don't have to fight the browser - plus more prvgroup work
* master:
Diffstat (limited to 'mod/photo.php')
-rw-r--r-- | mod/photo.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/mod/photo.php b/mod/photo.php index 1d38fe8e4..3cd8250a9 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -28,6 +28,8 @@ function photo_init(&$a) { } }*/ + $prvcachecontrol = false; + switch($a->argc) { case 4: $person = $a->argv[3]; @@ -134,6 +136,7 @@ function photo_init(&$a) { ); if(count($r)) { $data = file_get_contents('images/nosign.jpg'); + $prvcachecontrol = true; } } } @@ -179,8 +182,22 @@ function photo_init(&$a) { } header("Content-type: image/jpeg"); - header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"); - header("Cache-Control: max-age=" . (3600*24)); + + if($prvcachecontrol) { + + // it is a private photo that they have no permission to view. + // tell the browser not to cache it, in case they authenticate + // and subsequently have permission to see it + + header("Cache-Control: no-store, no-cache, must-revalidate"); + + } + else { + + header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"); + header("Cache-Control: max-age=" . (3600*24)); + + } echo $data; killme(); // NOTREACHED |