From 5a4d2491058b0972146f9b7897b87d42102faee7 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 8 Dec 2009 12:43:29 +0000 Subject: 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 --- engine/lib/group.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engine/lib/group.php') 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; } -- cgit v1.2.3