function og_deny in Organic groups 6
Same name and namespace in other branches
- 5.8 og.module \og_deny()
- 5 og.module \og_deny()
- 5.2 og.module \og_deny()
- 5.3 og.module \og_deny()
- 5.7 og.module \og_deny()
- 6.2 og.module \og_deny()
File
- ./
og.module, line 759
Code
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}");
}