You are here

function user_external_invite_cancel_invites in User External Invite 7

Same name and namespace in other branches
  1. 7.2 user_external_invite.module \user_external_invite_cancel_invites()
  2. 1.0.x user_external_invite.module \user_external_invite_cancel_invites()

Callback to cancel/remove pending invites.

Parameters

array $ids: Ids to be deleted.

1 call to user_external_invite_cancel_invites()
user_external_invite_pending_invites_form_submit in ./user_external_invite.module
Submit callback for user_external_invite_pending_invites_form().

File

./user_external_invite.module, line 322
Invites a user to site when connecting via external protocol e.g. LDAP.

Code

function user_external_invite_cancel_invites($ids = array()) {

  // Delete pending invites from database and set message.
  db_delete('user_external_invite')
    ->condition('id', $ids, 'IN')
    ->execute();
  drupal_set_message(t('Deleted :ids user :invites.', array(
    ':ids' => count($ids),
    ':invites' => count($ids) > 1 ? 'invites' : 'invite',
  )));
}