domain_check_primary

Versions
domain
domain_check_primary($msg = 'default')

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.

Code

./domain.module, line 996

<?php
function domain_check_primary($msg = 'default') {
  global $_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.'));
    }
    else if (!empty($msg)) {
      drupal_set_message($msg);
    }
    domain_goto($default);
  }
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List