You are here

function invite_cancel_account_invite in Invite 6.2

Same name and namespace in other branches
  1. 5.2 invite_cancel_account.module \invite_cancel_account_invite()
  2. 5 invite_cancel_account.module \invite_cancel_account_invite()

Implementation of hook_invite().

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

File

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

Code

function invite_cancel_account_invite($op, $args) {
  switch ($op) {
    case 'cancel':
      if (user_access('withdraw accepted invitations')) {
        if ($account = user_load(array(
          'mail' => $args['email'],
        ))) {
          user_delete(array(), $account->uid);
        }
      }
      break;
  }
}