Added redirecting to static image file and caching for contacts with no photo embedded.
This commit is contained in:
parent
ce13b3b7cd
commit
dc942d6f3e
1 changed files with 12 additions and 5 deletions
|
@ -22,7 +22,8 @@
|
||||||
|
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
OC_Util::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
//OC_Util::checkLoggedIn();
|
||||||
OC_Util::checkAppEnabled('contacts');
|
OC_Util::checkAppEnabled('contacts');
|
||||||
|
|
||||||
if(!function_exists('imagecreatefromjpeg')) {
|
if(!function_exists('imagecreatefromjpeg')) {
|
||||||
|
@ -33,10 +34,16 @@ if(!function_exists('imagecreatefromjpeg')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStandardImage(){
|
function getStandardImage(){
|
||||||
$src_img = imagecreatefrompng('img/person.png');
|
$date = new DateTime('now');
|
||||||
header('Content-Type: image/png');
|
$date->add(new DateInterval('P10D'));
|
||||||
imagepng($src_img);
|
header('Expires: '.$date->format(DateTime::RFC850));
|
||||||
imagedestroy($src_img);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue