og_deny

Versions
5
og_deny($gid, $uid)
6
og_deny($node, $account, $token)

Code

contributions/og/og.module, line 680

<?php
function og_deny($node, $account, $token) {
  if (!og_check_token($token, $node->nid)) {
    drupal_set_message(t('Bad token. You seem to have followed an invalid link.'), 'error');
    drupal_access_denied();
    return;
  }
  og_delete_subscription($node->nid, $account->uid);
  drupal_set_message(t('Membership request denied.'));
  
  $variables = array(
    '@title' => $node->title,
    '!group_url' => url("node/$node->nid", array('absolute' => TRUE))
  );

  $message = array(
    'subject' => _og_mail_text('og_deny_user_subject', $variables),
    'body' => _og_mail_text('og_deny_user_body', $variables)
  );

  module_invoke_all('og', 'user deny', $node->nid, $account->uid, $message);
  drupal_goto("node/$node->nid");
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.