function domain_check_primary in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain.module \domain_check_primary()
- 7.2 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 - Implement domain_delete_form.
- domain_form in ./
domain.admin.inc - FormsAPI for editing a domain record
File
- ./
domain.module, line 1249 - Core module functions for the Domain Access suite.
Code
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);
}
}