aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-05-01 18:35:40 -0700
committerBrett Profitt <brett.profitt@gmail.com>2012-05-01 18:37:16 -0700
commita198fe67109af23a398f8a152d693074dc041396 (patch)
tree8e64b2724a69a8451dfce6010ea444cadf7d5870
parentb95ed85ddb4a07014f989c13375e0a9e54fa9826 (diff)
downloadelgg-a198fe67109af23a398f8a152d693074dc041396.tar.gz
elgg-a198fe67109af23a398f8a152d693074dc041396.tar.bz2
Refs #2139. Checking in pages delete action for owner / admin
-rw-r--r--mod/pages/actions/pages/delete.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/mod/pages/actions/pages/delete.php b/mod/pages/actions/pages/delete.php
index dfa0de98d..7a314a280 100644
--- a/mod/pages/actions/pages/delete.php
+++ b/mod/pages/actions/pages/delete.php
@@ -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