aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-28 01:19:30 -0700
committerfriendica <info@friendica.com>2014-03-28 01:19:30 -0700
commit85d61813ca152d4866168a3366d451fd56c87378 (patch)
tree088fe744f656cc25e978fd94e7be4e7e2ccd4a78 /mod/item.php
parent34403d3bd3dc6c372187e9c75ac90f288cb88177 (diff)
downloadvolse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.tar.gz
volse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.tar.bz2
volse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.zip
another complication to deletion
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php
index 3d1ede507..d8101cf01 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -899,20 +899,27 @@ function item_content(&$a) {
if($i) {
$can_delete = false;
+ $local_delete = false;
if(local_user() && local_user() == $i[0]['uid'])
- $can_delete = true;
+ $local_delete = true;
+
$ob_hash = get_observer_hash();
if($ob_hash && ($ob_hash === $i[0]['author_xchan'] || $ob_hash === $i[0]['owner_xchan'] || $ob_hash === $i[0]['source_xchan']))
$can_delete = true;
- if(! $can_delete) {
+ if(! ($can_delete || $local_delete)) {
notice( t('Permission denied.') . EOL);
return;
}
- if($i[0]['item_restrict'])
+ // if this is a different page type or it's just a local delete
+ // but not by the item author or owner, do a simple deletion
+
+ if($i[0]['item_restrict'] || ($local_delete && (! $can_delete))) {
drop_item($i[0]['id']);
+ }
else {
+ // complex deletion that needs to propagate and be performed in phases
drop_item($i[0]['id'],true,DROPITEM_PHASE1);
tag_deliver($i[0]['uid'],$i[0]['id']);
}