You are here

function og_deny in Organic groups 5.3

Same name and namespace in other branches
  1. 5.8 og.module \og_deny()
  2. 5 og.module \og_deny()
  3. 5.2 og.module \og_deny()
  4. 5.7 og.module \og_deny()
  5. 6.2 og.module \og_deny()
  6. 6 og.module \og_deny()
1 string reference to 'og_deny'
og_menu in ./og.module

File

./og.module, line 487

Code

function og_deny($gid, $uid) {
  $node = node_load($gid);
  if (og_is_node_admin($node)) {
    og_delete_subscription($gid, $uid);
    drupal_set_message(t('Membership request denied.'));
    $variables = array(
      '@title' => $node->title,
      '!group_url' => url("node/{$node->nid}", NULL, NULL, TRUE),
    );
    $message = array(
      'subject' => _og_user_mail_text('og_deny_user_subject', $variables),
      'body' => _og_user_mail_text('og_deny_user_body', $variables),
    );
    module_invoke_all('og', 'user deny', $gid, $uid, $message);
    drupal_goto("node/{$gid}");
  }
  else {
    drupal_access_denied();
  }
}