local_user => local_channel
This commit is contained in:
@@ -1967,7 +1967,7 @@ function item_store($arr,$allow_exec = false) {
|
||||
$arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']);
|
||||
|
||||
|
||||
if(local_user() && (! $arr['sig'])) {
|
||||
if(local_channel() && (! $arr['sig'])) {
|
||||
$channel = get_app()->get_channel();
|
||||
if($channel['channel_hash'] === $arr['author_xchan']) {
|
||||
$arr['sig'] = base64url_encode(rsa_sign($arr['body'],$channel['channel_prvkey']));
|
||||
@@ -2355,7 +2355,7 @@ function item_store_update($arr,$allow_exec = false) {
|
||||
// apply the input filter here - if it is obscured it has been filtered already
|
||||
$arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']);
|
||||
|
||||
if(local_user() && (! $arr['sig'])) {
|
||||
if(local_channel() && (! $arr['sig'])) {
|
||||
$channel = get_app()->get_channel();
|
||||
if($channel['channel_hash'] === $arr['author_xchan']) {
|
||||
$arr['sig'] = base64url_encode(rsa_sign($arr['body'],$channel['channel_prvkey']));
|
||||
@@ -3949,7 +3949,7 @@ function retain_item($id) {
|
||||
function drop_items($items) {
|
||||
$uid = 0;
|
||||
|
||||
if(! local_user() && ! remote_user())
|
||||
if(! local_channel() && ! remote_user())
|
||||
return;
|
||||
|
||||
if(count($items)) {
|
||||
@@ -4005,7 +4005,7 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal
|
||||
$ok_to_delete = true;
|
||||
|
||||
// owner deletion
|
||||
if(local_user() && local_user() == $item['uid'])
|
||||
if(local_channel() && local_channel() == $item['uid'])
|
||||
$ok_to_delete = true;
|
||||
|
||||
// author deletion
|
||||
@@ -4472,7 +4472,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
|
||||
|
||||
$r = q("SELECT abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and not ( abook_flags & " . intval(ABOOK_FLAG_BLOCKED) . ")>0 limit 1",
|
||||
intval($arr['cid']),
|
||||
intval(local_user())
|
||||
intval(local_channel())
|
||||
);
|
||||
if($r) {
|
||||
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval($arr['uid']) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) and item_restrict = 0 ) ";
|
||||
|
||||
Reference in New Issue
Block a user