You are here

function og_ui_confirm_unsubscribe_submit in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og_ui/og_ui.pages.inc \og_ui_confirm_unsubscribe_submit()

Submit handler; Confirm OG unsubscription.

File

og_ui/og_ui.pages.inc, line 246
Page callbacks for Organic groups module.

Code

function og_ui_confirm_unsubscribe_submit($form, &$form_state) {
  $group_type = $form_state['values']['group_type'];
  $group = $form_state['values']['group'];
  og_ungroup($group_type, $group);
  if (entity_access('view', $group_type, $group)) {
    $form_state['redirect'] = entity_uri($group_type, $group);
  }
  else {
    $form_state['redirect'] = '<front>';
  }
}