From 2a96f2531b6ce8388ee0c63a335d6c48c5ed5a66 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 26 Feb 2009 15:29:51 +0000 Subject: Closes #801, Refs #277: Group join/request logic altered. git-svn-id: https://code.elgg.org/elgg/trunk@2965 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/actions/join.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'mod/groups/actions/join.php') diff --git a/mod/groups/actions/join.php b/mod/groups/actions/join.php index 7e55306f5..ab18c39a0 100644 --- a/mod/groups/actions/join.php +++ b/mod/groups/actions/join.php @@ -14,14 +14,10 @@ gatekeeper(); - $user_guid = get_input('user_guid'); + $user_guid = get_input('user_guid', get_loggedin_userid()); $group_guid = get_input('group_guid'); - $user = NULL; - if (!$user_guid) $user = $_SESSION['user']; - else - $user = get_entity($user_guid); - + $user = get_entity($user_guid); $group = get_entity($group_guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) @@ -33,8 +29,9 @@ system_message(elgg_echo("groups:joined")); // Remove any invite or join request flags - remove_metadata($user->guid, 'group_invite', $group->guid); - remove_metadata($user->guid, 'group_join_request', $group->guid); + remove_entity_relationship($group->guid, 'invited', $user->guid); + remove_entity_relationship($user->guid, 'membership_request', $group->guid); + // add to river add_to_river('river/group/create','join',$user->guid,$group->guid); -- cgit v1.2.3