From dc942d6f3e5f4845cf1e3588ac6116da783d45c8 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 19 Jan 2012 16:00:41 +0100 Subject: [PATCH] Added redirecting to static image file and caching for contacts with no photo embedded. --- apps/contacts/thumbnail.php | 17 ++++++++++++----- 1 file 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); } -- 2.39.5