function og_deny in Organic groups 5
Same name and namespace in other branches
- 5.8 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()
- 6 og.module \og_deny()
File
- ./
og.module, line 494
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),
);
$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();
}
}