You are here

function invite_cancel_account_invite_withdraw in Invite 7.2

Implements hook_invite_withdraw().

Withdrawing an invitation leads to termination of invited user's account.

File

modules/invite_cancel_account/invite_cancel_account.module, line 14
Allows your users to terminate user accounts by withdrawing their invitation.

Code

function invite_cancel_account_invite_withdraw($invite) {
  if (user_access('withdraw own accepted invitations')) {
    if ($account = user_load($invite->invitee)) {

      // @todo Make $method configurable.
      user_cancel(array(), $account->uid, 'user_cancel_block');
      batch_process();
    }
  }
}