You are here

function invite_withdraw_form_submit in Invite 7.4

Submit handler to withdraw an invitation.

_state

Parameters

$form:

File

includes/invite.pages.inc, line 152

Code

function invite_withdraw_form_submit($form, &$form_state) {
  $invite = $form_state['values']['invite'];
  db_update('invite')
    ->fields(array(
    'canceled' => 1,
    'status' => INVITE_WITHDRAWN,
  ))
    ->condition('reg_code', $invite->reg_code)
    ->execute();
  drupal_set_message(t('!invite has been withdrawn.', array(
    '!invite' => l('Invitation', 'invite/' . $invite->iid),
  )));

  // Notify other modules.
  module_invoke_all('invite_withdraw', $invite);
  if (module_exists('rules')) {
    rules_invoke_event('invite_withdraw', $invite);
  }
  $form_state['redirect'] = '<front>';
}