You are here

function _group_ui_redirect in Organic groups 7

Helper function; Redirect back to entity, if access is allowed.

Parameters

$entity_type:

$entity:

Return value

unknown_type

2 calls to _group_ui_redirect()
og_ui_subscribe in og_ui/og_ui.pages.inc
Manage user subscription to a group.
og_ui_unsubscribe in og_ui/og_ui.pages.inc
Confirm OG unsubscription form.

File

og_ui/og_ui.pages.inc, line 185
Page callbacks for Group module.

Code

function _group_ui_redirect($entity_type, $entity, $account = NULL) {

  // Redirect back to entity, if access is allowed. Access is checked only
  // for nodes.
  $uri = array();
  if ($entity_type == 'node') {
    if (!node_access('view', $entity, $account)) {
      $uri = array(
        'path' => '<front>',
        'options' => array(),
      );
    }
  }
  if (!$uri) {
    $uri = entity_uri($entity_type, $entity);
  }
  drupal_goto($uri['path'], $uri['options']);
}