aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 18:55:47 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 18:55:47 +0000
commit850f987aceda06ad195accfe0912d6b061bb305c (patch)
tree108cff53ede172375fa0167cb2915452e0c31b40
parent771090d86b1b59cd6647200f7a66cb8aa03b8bc3 (diff)
downloadelgg-850f987aceda06ad195accfe0912d6b061bb305c.tar.gz
elgg-850f987aceda06ad195accfe0912d6b061bb305c.tar.bz2
Fixed the can_write_to_container function when you're logged out.
git-svn-id: https://code.elgg.org/elgg/trunk@1480 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/entities.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 161ba5487..97518e886 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1007,12 +1007,14 @@
global $CONFIG;
$user_guid = (int)$user_guid;
- if (!$user_guid) $user_guid = $_SESSION['user']->getGUID();
+ 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))
@@ -1192,13 +1194,13 @@
if (!is_array($owner_guid)) {
$owner_array = array($owner_guid);
$owner_guid = (int) $owner_guid;
- $where[] = "owner_guid = '$owner_guid'";
+ // $where[] = "owner_guid = '$owner_guid'";
} else if (sizeof($owner_guid) > 0) {
- $owner_array = $owner_guid;
+ $owner_array = array_map('sanitise_int', $owner_guid);
// Cast every element to the owner_guid array to int
- $owner_guid = array_map("sanitise_int", $owner_guid);
- $owner_guid = implode(",",$owner_guid);
- $where[] = "owner_guid in ({$owner_guid})";
+ // $owner_guid = array_map("sanitise_int", $owner_guid);
+ // $owner_guid = implode(",",$owner_guid);
+ // $where[] = "owner_guid in ({$owner_guid})";
}
if (is_null($container_guid)) {
$container_guid = $owner_array;