Added redirecting to static image file and caching for contacts with no photo embedded.

This commit is contained in:
Thomas Tanghus 2012-01-19 16:00:41 +01:00
parent ce13b3b7cd
commit dc942d6f3e
1 changed files with 12 additions and 5 deletions

View 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);
}