remote_user can now support multiple contacts being logged in at once

This commit is contained in:
friendica 2012-09-04 22:50:28 -07:00
parent a9deda1e5e
commit 4cd8233f61
13 changed files with 226 additions and 73 deletions

View file

@ -3702,9 +3702,21 @@ function drop_item($id,$interactive = true) {
$owner = $item['uid'];
$cid = 0;
// check if logged in user is either the author or owner of this item
if((local_user() == $item['uid']) || (remote_user() == $item['contact-id']) || (! $interactive)) {
if(is_array($_SESSION['remote'])) {
foreach($_SESSION['remote'] as $visitor) {
if($visitor['uid'] == $item['uid'] && $visitor['cid'] == $item['contact-id']) {
$cid = $visitor['cid'];
break;
}
}
}
if((local_user() == $item['uid']) || ($cid) || (! $interactive)) {
logger('delete item: ' . $item['id'], LOGGER_DEBUG);
// delete the item