aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/group.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-08 12:43:29 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-08 12:43:29 +0000
commit5a4d2491058b0972146f9b7897b87d42102faee7 (patch)
tree06646440c046560399abcf918f7273b9faa29d02 /engine/lib/group.php
parent62605a939ca3d8084b049e7c652aa7d8c735938c (diff)
downloadelgg-5a4d2491058b0972146f9b7897b87d42102faee7.tar.gz
elgg-5a4d2491058b0972146f9b7897b87d42102faee7.tar.bz2
fixes #1287 - users now removed from group acl when leaving group - changed order of event and relationship removal
git-svn-id: http://code.elgg.org/elgg/trunk@3741 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/group.php')
-rw-r--r--engine/lib/group.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/engine/lib/group.php b/engine/lib/group.php
index e85724ece..bbbde0f55 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -777,8 +777,9 @@ function join_group($group_guid, $user_guid) {
* @param int $user_guid The user.
*/
function leave_group($group_guid, $user_guid) {
- $result = remove_entity_relationship($user_guid, 'member', $group_guid);
+ // event needs to be triggered while user is still member of group to have access to group acl
trigger_elgg_event('leave', 'group', array('group' => get_entity($group_guid), 'user' => get_entity($user_guid)));
+ $result = remove_entity_relationship($user_guid, 'member', $group_guid);
return $result;
}