From 96d830c50c7650229b4fad2bdcb3e863ec0bdc2a Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 13 Aug 2008 22:27:01 +0000 Subject: Closes #227 and #243: Hopefully this has the fscking thing nailed to the wall. Please report any problems, especially is they relate to access permissions (granted when you shouldn't or denied when you should) git-svn-id: https://code.elgg.org/elgg/trunk@1912 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'engine/lib/entities.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 5a794024b..427dd5c7d 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -86,7 +86,7 @@ $this->attributes['access_id'] = 0; $this->attributes['time_created'] = ""; $this->attributes['time_updated'] = ""; - $this->attributes['enabled'] = ""; + $this->attributes['enabled'] = "yes"; // There now follows a bit of a hack /* Problem: To speed things up, some objects are split over several tables, this means that it requires @@ -1163,24 +1163,23 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_type = 'all') { global $CONFIG; - + $user_guid = (int)$user_guid; if (!$user_guid) $user_guid = (int) $_SESSION['guid']; $user = get_entity($user_guid); $container_guid = (int)$container_guid; if (!$container_guid) $container_guid = page_owner(); - if (!$container_guid) return true; - + $container = get_entity($container_guid); - + if (($container) && ($user)) { - + // If the user can edit the container, they can also write to it if ($container->canEdit()) return true; - + // Basics, see if the user is a member of the group. if ($container instanceof ElggGroup) { if (!$container->isMember($user)) { @@ -1189,7 +1188,7 @@ return true; } } - + // See if anyone else has anything to say return trigger_plugin_hook('container_permissions_check',$entity_type,array('container' => $container, 'user' => $user), false); -- cgit v1.2.3