From a2b2318106be9b133a7265697dc8776bcc248839 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 22 Sep 2011 20:03:09 -0700 Subject: [PATCH] provide permission error vs "not found" for protected photos --- mod/photos.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 424cc17b..7141919b 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -984,7 +984,15 @@ function photos_content(&$a) { ); if(! count($ph)) { - notice( t('Photo not available') . EOL ); + $ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' + LIMIT 1", + intval($owner_uid), + dbesc($datum) + ); + if(count($ph)) + notice( t('Permission denied. Access to this item may be restricted.')); + else + notice( t('Photo not available') . EOL ); return; }