aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 15:16:50 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 15:16:50 +0000
commit4a92ecbc2d4ece4e2c2e5d0b7a7f8b2a6190a285 (patch)
treebc409fa9efce6529492465c0284c5f7e265e6e49 /engine/lib/entities.php
parent8d90e1b4719d052398b4d7c6b5618fea11399f4d (diff)
downloadelgg-4a92ecbc2d4ece4e2c2e5d0b7a7f8b2a6190a285.tar.gz
elgg-4a92ecbc2d4ece4e2c2e5d0b7a7f8b2a6190a285.tar.bz2
Closes #227. Depends on #243 to work.
git-svn-id: https://code.elgg.org/elgg/trunk@1903 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index dfb7492b0..31129fbad 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1466,8 +1466,8 @@
$guid = (int)$guid;
$reason = sanitise_string($reason);
- if ($entity = get_entity($guid)) {
- if (trigger_elgg_event('delete',$entity->type,$entity)) {
+ if ($entity = get_entity($guid)) {
+ if (trigger_elgg_event('delete',$entity->type,$entity)) {
if ($entity->canEdit()) {
if ($reason)
@@ -1740,18 +1740,20 @@
if ($entity = get_entity($entity_guid)) {
+ $return = false;
+
// Test user if possible - should default to false unless a plugin hook says otherwise
if (!is_null($user))
{
- if ($entity->getOwner() == $user->getGUID()) return true;
- if ($entity->container_guid == $user->getGUID()) return true;
- if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true;
+ if ($entity->getOwner() == $user->getGUID()) $return = true;
+ if ($entity->container_guid == $user->getGUID()) $return = true;
+ if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) $return = true;
if ($container_entity = get_entity($entity->container_guid)) {
- if ($container_entity->canEdit()) return true;
+ if ($container_entity->canEdit()) $return = true;
}
}
- return trigger_plugin_hook('permissions_check',$entity->type,array('entity' => $entity, 'user' => $user),false);
+ return trigger_plugin_hook('permissions_check',$entity->type,array('entity' => $entity, 'user' => $user), $return);
} else {
return false;