You are here

function domain_goto in Domain Access 7.3

Same name and namespace in other branches
  1. 5 domain.module \domain_goto()
  2. 6.2 domain.module \domain_goto()
  3. 7.2 domain.module \domain_goto()

Determine if we must switch the active domain.

This function will execute a drupal_goto() to pop users to the correct domain.

Parameters

$domain: The currently active $domain array, provided by domain_lookup().

3 calls to domain_goto()
domain_check_primary in ./domain.module
Check to see if a redirect to the primary domain is needed.
domain_form_alter in ./domain.module
Implements hook_form_alter().
domain_node_save_redirect in ./domain.module
On a node save, make sure the editor is returned to a domain that can view the node.

File

./domain.module, line 1709
Core module functions for the Domain Access suite.

Code

function domain_goto($domain) {
  $_domain = domain_get_domain();

  // We must be on the proper domain, see http://drupal.org/node/186153.
  if ($domain != -1 && $_domain['domain_id'] != $domain['domain_id']) {
    $path = domain_get_uri($domain);
    drupal_goto($path);
  }
}