From f902e1acd5e79b0d76afb90df057c0d04ddbe615 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 26 Feb 2010 20:31:15 +0000 Subject: Fixes #1540: Added site_guid to get_user_access_collections(). git-svn-id: http://code.elgg.org/elgg/trunk@3975 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/access.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/access.php b/engine/lib/access.php index a626bae7e..fa9510d7a 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -600,13 +600,23 @@ function remove_user_from_access_collection($user_guid, $collection_id) { * Get all of a users collections * * @param int $owner_guid The user ID + * @param int $site_guid The GUID of the site (default: current site). * @return true|false Depending on success */ -function get_user_access_collections($owner_guid) { +function get_user_access_collections($owner_guid, $site_guid = 0) { global $CONFIG; $owner_guid = (int) $owner_guid; + $site_guid = (int) $site_guid; + + if (($site_guid == 0) && (isset($CONFIG->site_guid))) { + $site_guid = $CONFIG->site_guid; + } + + $query = "SELECT * FROM {$CONFIG->dbprefix}access_collections + WHERE owner_guid = {$owner_guid} + AND site_guid = {$site_guid}"; - $collections = get_data("SELECT * FROM {$CONFIG->dbprefix}access_collections WHERE owner_guid = {$owner_guid}"); + $collections = get_data($query); return $collections; } -- cgit v1.2.3