diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-01-19 16:00:41 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-01-19 16:07:17 +0100 |
commit | dc942d6f3e5f4845cf1e3588ac6116da783d45c8 (patch) | |
tree | 69b51735d55be1daa52101a58f77ffdf13bffb13 /apps/contacts/thumbnail.php | |
parent | ce13b3b7cdfdfd4c6bef3bbace572c91372286ab (diff) | |
download | nextcloud-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.php | 17 |
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); } |