You are here

function og_create_admin_confirm_submit in Organic groups 5.2

Same name and namespace in other branches
  1. 5.8 og.module \og_create_admin_confirm_submit()
  2. 5 og.module \og_create_admin_confirm_submit()
  3. 5.3 og.module \og_create_admin_confirm_submit()
  4. 5.7 og.module \og_create_admin_confirm_submit()
  5. 6.2 og.pages.inc \og_create_admin_confirm_submit()
  6. 6 og.module \og_create_admin_confirm_submit()

Confirm og create admin form

File

./og.module, line 526

Code

function og_create_admin_confirm_submit($form_id, $form_values) {
  $account = $form_values['account'];
  $node = $form_values['node'];
  og_save_subscription($node->nid, $account->uid, array(
    'is_admin' => 1,
  ));
  drupal_set_message(t('%name was promoted to %ga', array(
    '%name' => $account->name,
    '%ga' => t('group administrator'),
  )));
  $variables = array(
    '@group' => $node->title,
    '!group_url' => url("node/{$node->nid}", NULL, NULL, TRUE),
    '@username' => $account->name,
  );
  $from = variable_get('site_mail', ini_get('sendmail_from'));
  drupal_mail('og_new_admin', $account->mail, _og_user_mail_text('og_new_admin_subject', $variables), _og_user_mail_text('og_new_admin_body', $variables), $from);
  return "og/users/{$node->nid}";
}