diff options
author | friendica <info@friendica.com> | 2014-03-28 01:19:30 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-03-28 01:19:30 -0700 |
commit | 85d61813ca152d4866168a3366d451fd56c87378 (patch) | |
tree | 088fe744f656cc25e978fd94e7be4e7e2ccd4a78 | |
parent | 34403d3bd3dc6c372187e9c75ac90f288cb88177 (diff) | |
download | volse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.tar.gz volse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.tar.bz2 volse-hubzilla-85d61813ca152d4866168a3366d451fd56c87378.zip |
another complication to deletion
-rw-r--r-- | mod/item.php | 13 |
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']); } |