You are here

function domain_goto in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain.module \domain_goto()
  2. 7.3 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().

4 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
Implement 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.
domain_user_init in domain_user/domain_user.module
Implement hook_init()

File

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

Code

function domain_goto($domain) {
  global $_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);
  }
}