aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-31 15:56:43 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-31 15:56:43 +0000
commit1ad49aaf2f1cb23a81909576437997fffa3951d2 (patch)
tree6156d26c46dea52993708fed082c9c0dbdf37b07 /engine
parent4ab77c0ef0557d26781cbd3f534aeedd905d8637 (diff)
downloadelgg-1ad49aaf2f1cb23a81909576437997fffa3951d2.tar.gz
elgg-1ad49aaf2f1cb23a81909576437997fffa3951d2.tar.bz2
More updates for collections - save now works properly.
git-svn-id: https://code.elgg.org/elgg/trunk@1637 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/access.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index a1741f8bf..29f87a1f8 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -213,16 +213,21 @@
global $CONFIG;
$collection_id = (int) $collection_id;
- if ($collection = get_access_collection($collection_id)) {
- delete_data("delete from {$CONFIG->dbprefix}access_collection_membership where access_collection_id = {$collection_id}");
- }
+ $collections = get_write_access_array();
+
+ if (array_key_exists($collection_id, $collections)) {
- if (is_array($members) && sizeof($members) > 0) {
- foreach($members as $member) {
- $member = (int) $member;
- add_user_to_access_collection($member, $collection_id);
+ delete_data("delete from {$CONFIG->dbprefix}access_collection_membership where access_collection_id = {$collection_id}");
+
+ if (is_array($members) && sizeof($members) > 0) {
+ foreach($members as $member) {
+ $member = (int) $member;
+ if (get_user($member))
+ insert_data("insert into {$CONFIG->dbprefix}access_collection_membership set access_collection_id = {$collection_id}, user_guid = {$member}");
+ }
+ return true;
}
- return true;
+
}
return false;