aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-11 14:15:43 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-11 14:15:43 +0000
commit1af60ae2122e23b0a73ebe88ab448866927a6a92 (patch)
treef7890fa00504ca60bfbcba9546b117c0d419084f /mod/pages/start.php
parenta3a84cec2f5424a9195c38f299161278a623913a (diff)
downloadelgg-1af60ae2122e23b0a73ebe88ab448866927a6a92.tar.gz
elgg-1af60ae2122e23b0a73ebe88ab448866927a6a92.tar.bz2
Fixes #2672 limiting deleting pages and creating sub pages
git-svn-id: http://code.elgg.org/elgg/trunk@9170 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/start.php')
-rw-r--r--mod/pages/start.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 2e2bc1ed6..fded5fee9 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -231,6 +231,15 @@ function pages_entity_menu_setup($hook, $type, $return, $params) {
return $return;
}
+ // remove delete if not owner or admin
+ if (!elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != $entity->getOwnerGuid()) {
+ foreach ($return as $index => $item) {
+ if ($item->getName() == 'delete') {
+ unset($return[$index]);
+ }
+ }
+ }
+
$options = array(
'name' => 'history',
'text' => elgg_echo('pages:history'),