1
1
Fork 0

Return to item if not owned by user or canceld

This commit is contained in:
Jonny Tischbein 2018-10-09 20:40:25 +02:00
parent d8780b1640
commit d18421f760

View file

@ -349,7 +349,7 @@ function drop_item($id)
// locate item to be deleted // locate item to be deleted
$fields = ['id', 'uid', 'contact-id', 'deleted']; $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted'];
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]); $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
@ -401,7 +401,7 @@ function drop_item($id)
} }
// Now check how the user responded to the confirmation query // Now check how the user responded to the confirmation query
if (!empty($_REQUEST['canceled'])) { if (!empty($_REQUEST['canceled'])) {
goaway('/item/drop/' . $id); goaway('/display/' . $item['guid']);
} }
// delete the item // delete the item
@ -411,7 +411,7 @@ function drop_item($id)
//NOTREACHED //NOTREACHED
} else { } else {
notice(L10n::t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway('/item/drop/' . $id); goaway('/display/' . $item['guid']);
//NOTREACHED //NOTREACHED
} }
} }