From 4766f36a4d74924f21ff329c4318ce4e069ffa04 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 3 Mar 2010 17:53:05 +0000 Subject: Pulled in the interface changes. git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/actions/join.php | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mod/groups/actions/join.php (limited to 'mod/groups/actions/join.php') diff --git a/mod/groups/actions/join.php b/mod/groups/actions/join.php new file mode 100644 index 000000000..3947f8efc --- /dev/null +++ b/mod/groups/actions/join.php @@ -0,0 +1,65 @@ +isPublicMembership()) + { + if ($group->join($user)) + { + system_message(elgg_echo("groups:joined")); + + // Remove any invite or join request flags + 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); + + forward($group->getURL()); + exit; + } + else + register_error(elgg_echo("groups:cantjoin")); + } + else + { + // Closed group, request membership + system_message(elgg_echo('groups:privategroup')); + forward(elgg_add_action_tokens_to_url($CONFIG->url . "action/groups/joinrequest?user_guid=$user_guid&group_guid=$group_guid")); + exit; + } + } + else + register_error(elgg_echo("groups:cantjoin")); + + forward($_SERVER['HTTP_REFERER']); + exit; +?> -- cgit v1.2.3