remote_user can now support multiple contacts being logged in at once
This commit is contained in:
parent
a9deda1e5e
commit
4cd8233f61
13 changed files with 226 additions and 73 deletions
17
mod/item.php
17
mod/item.php
|
@ -306,6 +306,7 @@ function item_post(&$a) {
|
|||
|
||||
$author = null;
|
||||
$self = false;
|
||||
$contact_id = 0;
|
||||
|
||||
if((local_user()) && (local_user() == $profile_uid)) {
|
||||
$self = true;
|
||||
|
@ -314,9 +315,19 @@ function item_post(&$a) {
|
|||
);
|
||||
}
|
||||
elseif(remote_user()) {
|
||||
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||
intval(remote_user())
|
||||
);
|
||||
if(is_array($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $v) {
|
||||
if($v['uid'] == $profile_uid) {
|
||||
$contact_id = $v['cid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($contact_id) {
|
||||
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||
intval($contact_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if(count($r)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue