From e0d99db103d1b0b0a73ae5b41ab3d332334cb099 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 24 Oct 2008 10:27:36 +0000 Subject: Revert. git-svn-id: https://code.elgg.org/elgg/trunk@2303 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'engine/lib/entities.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 92ef5a84e..ba376917b 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -458,9 +458,9 @@ * @param int $user_guid The user. * @return bool */ - public function canWriteToContainer($user_guid = 0, $entity = null) + public function canWriteToContainer($user_guid = 0) { - return can_write_to_container($user_guid, $this->getGUID(), 'all', $entity); + return can_write_to_container($user_guid, $this->getGUID()); } /** @@ -1160,11 +1160,9 @@ * Determine whether a given user is able to write to a given container. * * @param int $user_guid The user guid, or 0 for $_SESSION['user']->getGUID() - * @param int $container_guid The container, or 0 for the current page owner. - * @param string $entity_type The type of entity, or all for all - * @param ElggEntity $entity Optionally, the entity + * @param int $container_guid The container, or 0 for the current page owner. */ - function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_type = 'all', $entity = null) + function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_type = 'all') { global $CONFIG; @@ -1194,7 +1192,7 @@ } // See if anyone else has anything to say - return trigger_plugin_hook('container_permissions_check',$entity_type,array('container' => $container, 'user' => $user, 'entity' => $entity), false); + return trigger_plugin_hook('container_permissions_check',$entity_type,array('container' => $container, 'user' => $user), false); } @@ -1224,18 +1222,8 @@ $site_guid = $CONFIG->site_guid; $site_guid = (int) $site_guid; if ($container_guid == 0) $container_guid = $owner_guid; - - $temptity = new ElggEntity(); - $temptity->type = $type; - $temptity->subtype = $subtype; - $temptity->owner_guid = $owner_guid; - $temptity->access_id = $access_id; - $temptity->site_guid = $site_guid; - $temptity->container_guid = $container_guid; - $temptity->time_created = $time; - $temptity->time_updated = $time; - - if (!can_write_to_container($owner_guid, $container_guid, $type, $temptity)) return false; + + if (!can_write_to_container($owner_guid, $container_guid, $type)) return false; if ($type=="") throw new InvalidParameterException(elgg_echo('InvalidParameterException:EntityTypeNotSet')); -- cgit v1.2.3