You are here

function domain_check_primary in Domain Access 7.2

Same name and namespace in other branches
  1. 6.2 domain.module \domain_check_primary()
  2. 7.3 domain.module \domain_check_primary()

Check to see if a redirect to the primary domain is needed.

If TRUE, issue a redirect and print a message.

Parameters

$msg: The message to print. Optional. If passed, this string must be translated and safe.

2 calls to domain_check_primary()
domain_delete_form in ./domain.admin.inc
A delete confirmation form.
domain_form in ./domain.admin.inc
FormsAPI for editing a domain record

File

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

Code

function domain_check_primary($msg = 'default') {
  $_domain = domain_get_domain();
  $default = domain_default();
  if ($_domain['domain_id'] != $default['domain_id']) {
    if ($msg == 'default') {
      drupal_set_message(t('You have been redirected: This page must be accessed from the primary domain.'));
    }
    elseif (!empty($msg)) {
      drupal_set_message($msg);
    }
    domain_goto($default);
  }
}