a couple of places where we need to look for a sys channel euid.
This commit is contained in:
parent
06e5d0798c
commit
570577a990
@ -2021,7 +2021,14 @@ function json_decode_plus($s) {
|
|||||||
|
|
||||||
|
|
||||||
function design_tools() {
|
function design_tools() {
|
||||||
|
|
||||||
$channel = get_app()->get_channel();
|
$channel = get_app()->get_channel();
|
||||||
|
|
||||||
|
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] == 1 && is_site_admin()) {
|
||||||
|
require_once('include/identity.php');
|
||||||
|
$channel = get_sys_channel();
|
||||||
|
}
|
||||||
|
|
||||||
$who = $channel['channel_address'];
|
$who = $channel['channel_address'];
|
||||||
|
|
||||||
return replace_macros(get_markup_template('design_tools.tpl'), array(
|
return replace_macros(get_markup_template('design_tools.tpl'), array(
|
||||||
|
28
mod/item.php
28
mod/item.php
@ -32,9 +32,17 @@ function item_post(&$a) {
|
|||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = local_user();
|
||||||
|
|
||||||
$channel = null;
|
$channel = null;
|
||||||
|
|
||||||
|
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] == 1 && is_site_admin()) {
|
||||||
|
require_once('include/identity.php');
|
||||||
|
$sys = get_sys_channel();
|
||||||
|
if($sys && intval($sys['channel_id'])) {
|
||||||
|
$uid = intval($sys['channel_id']);
|
||||||
|
$channel = $sys;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(x($_REQUEST,'dropitems')) {
|
if(x($_REQUEST,'dropitems')) {
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
$arr_drop = explode(',',$_REQUEST['dropitems']);
|
$arr_drop = explode(',',$_REQUEST['dropitems']);
|
||||||
@ -87,8 +95,8 @@ function item_post(&$a) {
|
|||||||
/*
|
/*
|
||||||
* Check service class limits
|
* Check service class limits
|
||||||
*/
|
*/
|
||||||
if (local_user() && !(x($_REQUEST,'parent')) && !(x($_REQUEST,'post_id'))) {
|
if ($uid && !(x($_REQUEST,'parent')) && !(x($_REQUEST,'post_id'))) {
|
||||||
$ret = item_check_service_class(local_user(),x($_REQUEST,'webpage'));
|
$ret = item_check_service_class($uid,x($_REQUEST,'webpage'));
|
||||||
if (!$ret['success']) {
|
if (!$ret['success']) {
|
||||||
notice( t($ret['message']) . EOL) ;
|
notice( t($ret['message']) . EOL) ;
|
||||||
if(x($_REQUEST,'return'))
|
if(x($_REQUEST,'return'))
|
||||||
@ -129,11 +137,11 @@ function item_post(&$a) {
|
|||||||
intval($parent)
|
intval($parent)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($parent_mid && local_user()) {
|
elseif($parent_mid && $uid) {
|
||||||
// This is coming from an API source, and we are logged in
|
// This is coming from an API source, and we are logged in
|
||||||
$r = q("SELECT * FROM `item` WHERE `mid` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `item` WHERE `mid` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($parent_mid),
|
dbesc($parent_mid),
|
||||||
intval(local_user())
|
intval($uid)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if this isn't the real parent of the conversation, find it
|
// if this isn't the real parent of the conversation, find it
|
||||||
@ -223,7 +231,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
|
|
||||||
if(! $channel) {
|
if(! $channel) {
|
||||||
if(local_user() && local_user() == $profile_uid) {
|
if($uid && $uid == $profile_uid) {
|
||||||
$channel = $a->get_channel();
|
$channel = $a->get_channel();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -446,7 +454,7 @@ function item_post(&$a) {
|
|||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
if($z && ($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
|
if($z && ($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
|
||||||
if(local_user() && (get_account_id() == $z[0]['account_id'])) {
|
if($uid && (get_account_id() == $z[0]['account_id'])) {
|
||||||
$execflag = true;
|
$execflag = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -461,7 +469,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
if($mimetype === 'text/bbcode') {
|
if($mimetype === 'text/bbcode') {
|
||||||
|
|
||||||
if(local_user() && local_user() == $profile_uid && feature_enabled(local_user(),'markdown')) {
|
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
|
||||||
require_once('include/bb2diaspora.php');
|
require_once('include/bb2diaspora.php');
|
||||||
$body = diaspora2bb(escape_tags($body),true);
|
$body = diaspora2bb(escape_tags($body),true);
|
||||||
}
|
}
|
||||||
@ -594,7 +602,7 @@ function item_post(&$a) {
|
|||||||
if($fullnametagged)
|
if($fullnametagged)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$success = handle_tag($a, $body, $access_tag, $str_tags, (local_user()) ? local_user() : $profile_uid , $tag);
|
$success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : $profile_uid , $tag);
|
||||||
logger('handle_tag: ' . print_r($success,tue), LOGGER_DATA);
|
logger('handle_tag: ' . print_r($success,tue), LOGGER_DATA);
|
||||||
if(($access_tag) && (! $parent_item)) {
|
if(($access_tag) && (! $parent_item)) {
|
||||||
logger('access_tag: ' . $tag . ' ' . print_r($access_tag,true), LOGGER_DATA);
|
logger('access_tag: ' . $tag . ' ' . print_r($access_tag,true), LOGGER_DATA);
|
||||||
@ -797,7 +805,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
$datarray['body'] = z_input_filter($datarray['uid'],$datarray['body'],$datarray['mimetype']);
|
$datarray['body'] = z_input_filter($datarray['uid'],$datarray['body'],$datarray['mimetype']);
|
||||||
|
|
||||||
if(local_user()) {
|
if($uid) {
|
||||||
if($channel['channel_hash'] === $datarray['author_xchan']) {
|
if($channel['channel_hash'] === $datarray['author_xchan']) {
|
||||||
$datarray['sig'] = base64url_encode(rsa_sign($datarray['body'],$channel['channel_prvkey']));
|
$datarray['sig'] = base64url_encode(rsa_sign($datarray['body'],$channel['channel_prvkey']));
|
||||||
$datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
|
$datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
|
||||||
|
Reference in New Issue
Block a user