diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-26 20:31:15 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-02-26 20:31:15 +0000 |
commit | f902e1acd5e79b0d76afb90df057c0d04ddbe615 (patch) | |
tree | 4325925554fab77e3b0b339ea9209b56166ecf47 /engine/lib/access.php | |
parent | 8bd1aa1b15e4a42b9a56e607a6548456c9fd8986 (diff) | |
download | elgg-f902e1acd5e79b0d76afb90df057c0d04ddbe615.tar.gz elgg-f902e1acd5e79b0d76afb90df057c0d04ddbe615.tar.bz2 |
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
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r-- | engine/lib/access.php | 14 |
1 files changed, 12 insertions, 2 deletions
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; } |