aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions/join.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-26 15:29:51 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-26 15:29:51 +0000
commit2a96f2531b6ce8388ee0c63a335d6c48c5ed5a66 (patch)
tree01ebe810d242031319da6a33d4f245ec79ece42d /mod/groups/actions/join.php
parent7ff413a3e44fe572c17119391e56af115aa93509 (diff)
downloadelgg-2a96f2531b6ce8388ee0c63a335d6c48c5ed5a66.tar.gz
elgg-2a96f2531b6ce8388ee0c63a335d6c48c5ed5a66.tar.bz2
Closes #801, Refs #277: Group join/request logic altered.
git-svn-id: https://code.elgg.org/elgg/trunk@2965 36083f99-b078-4883-b0ff-0f9b5a30f544
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);