You are here

invite_cancel_account.module in Invite 7.2

Allows your users to terminate user accounts by withdrawing their invitation.

File

modules/invite_cancel_account/invite_cancel_account.module
View source
<?php

/**
 * @file
 * Allows your users to terminate user accounts by withdrawing their
 * invitation.
 */

/**
 * Implements hook_invite_withdraw().
 *
 * Withdrawing an invitation leads to termination of invited user's account.
 */
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();
    }
  }
}