Merge https://github.com/friendica/red into zpull
This commit is contained in:
commit
b429a9496a
26
boot.php
26
boot.php
@ -1249,18 +1249,22 @@ function profile_load(&$a, $nickname, $profile = 0) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(remote_user() && count($_SESSION['remote'])) {
|
// get the current observer
|
||||||
foreach($_SESSION['remote'] as $visitor) {
|
$observer = $a->get_observer();
|
||||||
if($visitor['uid'] == $user[0]['channel_id']) {
|
|
||||||
$r = q("SELECT `profile_id` FROM `contact` WHERE `id` = %d LIMIT 1",
|
// Can the observer see our profile?
|
||||||
intval($visitor['cid'])
|
require_once('include/permissions.php');
|
||||||
|
if(! perm_is_allowed($user[0]['channel_id'],$observer['xchan_hash'],'view_profile')) {
|
||||||
|
// permission denied
|
||||||
|
//TODO: place error message
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$r = q("SELECT abook_profile FROM abook WHERE abook_xchan = '%s' limit 1",
|
||||||
|
dbesc($observer['xchan_hash'])
|
||||||
);
|
);
|
||||||
if(count($r))
|
if($r)
|
||||||
$profile = $r[0]['profile_id'];
|
$profile = $r[0]['abook_profile'];
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user