summaryrefslogtreecommitdiffstats
path: root/apps/contacts/thumbnail.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-01-19 16:00:41 +0100
committerThomas Tanghus <thomas@tanghus.net>2012-01-19 16:07:17 +0100
commitdc942d6f3e5f4845cf1e3588ac6116da783d45c8 (patch)
tree69b51735d55be1daa52101a58f77ffdf13bffb13 /apps/contacts/thumbnail.php
parentce13b3b7cdfdfd4c6bef3bbace572c91372286ab (diff)
downloadnextcloud-server-dc942d6f3e5f4845cf1e3588ac6116da783d45c8.tar.gz
nextcloud-server-dc942d6f3e5f4845cf1e3588ac6116da783d45c8.zip
Added redirecting to static image file and caching for contacts with no photo embedded.
Diffstat (limited to 'apps/contacts/thumbnail.php')
-rw-r--r--apps/contacts/thumbnail.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index e49098ce820..507e1c7b302 100644
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -22,7 +22,8 @@
// Init owncloud
require_once('../../lib/base.php');
-OC_Util::checkLoggedIn();
+OC_JSON::checkLoggedIn();
+//OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('contacts');
if(!function_exists('imagecreatefromjpeg')) {
@@ -33,10 +34,16 @@ if(!function_exists('imagecreatefromjpeg')) {
}
function getStandardImage(){
- $src_img = imagecreatefrompng('img/person.png');
- header('Content-Type: image/png');
- imagepng($src_img);
- imagedestroy($src_img);
+ $date = new DateTime('now');
+ $date->add(new DateInterval('P10D'));
+ header('Expires: '.$date->format(DateTime::RFC850));
+ header('Cache-Control: cache');
+ header('Location: '.OC_Helper::imagePath('contacts', 'person.png'));
+ exit();
+// $src_img = imagecreatefrompng('img/person.png');
+// header('Content-Type: image/png');
+// imagepng($src_img);
+// imagedestroy($src_img);
}