]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added redirecting to static image file and caching for contacts with no photo embedded.
authorThomas Tanghus <thomas@tanghus.net>
Thu, 19 Jan 2012 15:00:41 +0000 (16:00 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 19 Jan 2012 15:07:17 +0000 (16:07 +0100)
apps/contacts/thumbnail.php

index e49098ce8209b82953e9bf333e2b146c0571cd52..507e1c7b302e8eaa54f6d33c1516bf4b1c67f804 100644 (file)
@@ -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);
 }