You are here

function group_user_request_membership in Group 7

Request to join a group.

Parameters

Group $group: The group to join.

object $account: The user that wants to join.

1 string reference to 'group_user_request_membership'
group_group_membership_action_info in ./group.group.inc
Implements hook_group_membership_action_info().

File

./group.group.inc, line 461
Hook implementations for the Group module.

Code

function group_user_request_membership(Group $group, $account) {
  $group
    ->addMember($account->uid, array(
    'status' => 'requested',
    'requested_on' => REQUEST_TIME,
  ));
  drupal_set_message(t('You have requested to join the group.'));
}