domain_alias_domain_bootstrap_lookup

Versions
domain
domain_alias_domain_bootstrap_lookup($domain)

Implement hook_domain_bootstrap_lookup().

Tries to match the given domain name against patterns in the {domain_alias} table and, if successful, updates information in given parameter $domain.

See also

domain_resolve_name()

Parameters

$domain An array containing current domain (host) name and the results of lookup against {domain} table.

Return value

An array containing at least a valid domain_id. Other values are: -- 'active_alias_id' => the currently active alias. -- 'redirect' => a boolean flag telling the module to redirect to the registered domain name if accessed from an alias.

Code

domain_alias/domain_alias.module, line 39

<?php
function domain_alias_domain_bootstrap_lookup($domain) {
  // If we had an exact match, then $domain['sitename'] is populated.
  // Otherwise, we must do an advanced check.
  if (isset($domain['sitename'])) {
    return;
  }
  $alias = domain_alias_lookup($domain['subdomain']);
  if ($alias != -1) {
    $domain['domain_id'] = $alias['domain_id'];
    $domain['active_alias_id'] = $alias['alias_id'];
    $domain['redirect'] = (boolean) $alias['redirect'];
  }
  return $domain;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List