]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2139. Checking in pages delete action for owner / admin
authorBrett Profitt <brett.profitt@gmail.com>
Wed, 2 May 2012 01:35:40 +0000 (18:35 -0700)
committerBrett Profitt <brett.profitt@gmail.com>
Wed, 2 May 2012 01:37:16 +0000 (18:37 -0700)
mod/pages/actions/pages/delete.php

index dfa0de98df4fad653f2b989e9d207caeef11d996..7a314a280323eae98ae0c159f354cb0a97ec841d 100644 (file)
@@ -9,8 +9,9 @@
 
 $guid = get_input('guid');
 $page = get_entity($guid);
-if ($page) {
-       if ($page->canEdit()) {
+if (elgg_instanceof($page, 'object', 'page') || elgg_instanceof($page, 'object', 'page_top')) {
+       // only allow owners and admin to delete
+       if (elgg_is_admin_logged_in() || elgg_get_logged_in_user_guid() == $page->getOwnerGuid()) {
                $container = get_entity($page->container_guid);
 
                // Bring all child elements forward