diff options
Diffstat (limited to 'actions/widgets/delete.php')
-rw-r--r-- | actions/widgets/delete.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actions/widgets/delete.php b/actions/widgets/delete.php index 5b8aaf75e..47920013d 100644 --- a/actions/widgets/delete.php +++ b/actions/widgets/delete.php @@ -6,12 +6,13 @@ * @subpackage Widgets.Management */ -$guid = get_input('guid'); +$widget_guid = get_input('widget_guid'); +$owner_guid = get_input('owner_guid', elgg_get_logged_in_user_guid()); -$user = elgg_get_logged_in_user_entity(); +$widget = get_entity($widget_guid); +$owner = get_entity($owner_guid); -$widget = get_entity($guid); -if ($widget && $user->canEdit() && $widget->delete()) { +if ($widget && $owner->canEdit() && $widget->delete()) { forward(REFERER); } |