You are here

function ginvite_user_accept in Group 7

Accept a pending group invitation.

Parameters

Group $group: The group the invitation is for.

object $account: The user the invitation is for.

GroupMembership|false $group_membership: The group membership object for the invitation.

1 string reference to 'ginvite_user_accept'
ginvite_group_membership_action_info in modules/ginvite/ginvite.group.inc
Implements hook_group_membership_action_info().

File

modules/ginvite/ginvite.group.inc, line 115
Hook implementations for the Group module.

Code

function ginvite_user_accept(Group $group, $account, $group_membership) {
  $group_membership->status = 'active';
  $group_membership
    ->save();
  drupal_set_message(t('You have accepted the group invitation.'));
}