You are here

function ginvite_accept_callback in Group 7

Act upon accepting a group invitation from the user page.

See also

ginvite_user_page()

1 string reference to 'ginvite_accept_callback'
ginvite_menu in modules/ginvite/ginvite.router.inc
Implements hook_menu().

File

modules/ginvite/pages/ginvite.inc, line 89
Group member invite callback and pages.

Code

function ginvite_accept_callback($account, Group $group) {
  $group_membership = $group
    ->getMember($account->uid);
  $group_membership->status = 'active';
  $group_membership
    ->save();
  drupal_set_message(t('You have accepted the group invitation.'));
  drupal_goto("user/{$account->uid}/group/invite");
}