aboutsummaryrefslogtreecommitdiffstats
path: root/mod/editpost.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-15 19:36:17 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-15 19:36:17 -0800
commitfff30b1c3d7030ff63c880c13bcb47e2932cd1b8 (patch)
treefdab5272c37b5321c544475ca60c3ccc5a0efa02 /mod/editpost.php
parent6ad35e3d843bbc0483e21ed6f31c8942513290b6 (diff)
downloadvolse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.tar.gz
volse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.tar.bz2
volse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.zip
permission issues editing wall-to-wall posts
Diffstat (limited to 'mod/editpost.php')
-rw-r--r--mod/editpost.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/mod/editpost.php b/mod/editpost.php
index 2f999858f..bd46ac14a 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -21,9 +21,9 @@ function editpost_content(&$a) {
return;
}
- $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d and author_xchan = '%s' LIMIT 1",
+ $itm = q("SELECT * FROM `item` WHERE `id` = %d AND ( owner_xchan = '%s' OR author_xchan = '%s' ) LIMIT 1",
intval($post_id),
- intval(local_channel()),
+ dbesc(get_observer_hash()),
dbesc(get_observer_hash())
);
@@ -37,6 +37,8 @@ function editpost_content(&$a) {
}
+ $owner_uid = $itm[0]['uid'];
+
$plaintext = true;
// if(feature_enabled(local_channel(),'richtext'))
@@ -71,14 +73,12 @@ function editpost_content(&$a) {
call_hooks('jot_tool', $jotplugins);
call_hooks('jot_networks', $jotnets);
- $channel = $a->get_channel();
-
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
- $voting = feature_enabled(local_channel(),'consensus_tools');
+ $voting = feature_enabled($owner_uid,'consensus_tools');
$category = '';
- $catsenabled = ((feature_enabled(local_channel(),'categories')) ? 'categories' : '');
+ $catsenabled = ((feature_enabled($owner_uid,'categories')) ? 'categories' : '');
if ($catsenabled){
$itm = fetch_post_tags($itm);
@@ -145,7 +145,7 @@ function editpost_content(&$a) {
'$lockstate' => $lockstate,
'$acl' => '',
'$bang' => '',
- '$profile_uid' => local_channel(),
+ '$profile_uid' => $owner_uid,
'$preview' => t('Preview'),
'$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename),