aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions/join.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/actions/join.php')
-rw-r--r--mod/groups/actions/join.php13
1 files changed, 5 insertions, 8 deletions
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);