You are here

function og_deny in Organic groups 5.2

Same name and namespace in other branches
  1. 5.8 og.module \og_deny()
  2. 5 og.module \og_deny()
  3. 5.3 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 477

Code

function og_deny($gid, $uid) {
  $node = node_load($gid);
  if (node_access('update', $node)) {
    og_delete_subscription($gid, $uid);
    drupal_set_message(t('Subscription request denied.'));
    $variables = array(
      '@title' => $node->title,
      '!group_url' => url("node/{$node->nid}", NULL, NULL, TRUE),
    );
    $from = variable_get('site_mail', ini_get('sendmail_from'));
    $account = user_load(array(
      'uid' => $uid,
    ));
    drupal_mail('og_deny', $account->mail, _og_user_mail_text('og_deny_user_subject', $variables), _og_user_mail_text('og_deny_user_body', $variables), $from);
    drupal_goto("node/{$gid}");
  }
  else {
    drupal_access_denied();
  }
}