fix forbidden photos and vcard photo template
This commit is contained in:
parent
c803f620e6
commit
be7e732391
@ -112,17 +112,18 @@ function photo_init(&$a) {
|
|||||||
// There won't be many completely unauthorised people seeing this because
|
// There won't be many completely unauthorised people seeing this because
|
||||||
// they won't have the photo link, so there's a reasonable chance that the person
|
// they won't have the photo link, so there's a reasonable chance that the person
|
||||||
// might be able to obtain permission to view it.
|
// might be able to obtain permission to view it.
|
||||||
|
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `scale` = %d LIMIT 1",
|
$r = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `scale` = %d LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
logger('mod_photo: forbidden. ' . $a->query_string());
|
logger('mod_photo: forbidden. ' . $a->query_string);
|
||||||
$observer = $a->get_observer();
|
$observer = $a->get_observer();
|
||||||
logger('mod_photo: observer = ' . (($observer) ? $observer['xchan_addr'] : '(not authenticated)'));
|
logger('mod_photo: observer = ' . (($observer) ? $observer['xchan_addr'] : '(not authenticated)'));
|
||||||
$data = file_get_contents('images/nosign.png');
|
$data = file_get_contents('images/nosign.png');
|
||||||
$mimetype = 'image/jpeg';
|
$mimetype = 'image/png';
|
||||||
$prvcachecontrol = true;
|
$prvcachecontrol = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="vcard">
|
<div class="vcard">
|
||||||
<div class="fn">{{$name}}</div>
|
<div class="fn">{{$name}}</div>
|
||||||
<div id="profile-photo-wrapper"><img class="vcard-photo photo" src="{{$photo}}" alt="name" /></div>
|
<div id="profile-photo-wrapper"><img class="vcard-photo photo" src="{{$photo}}" alt="{{name}}" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user