function hook_allow_domain

7.x-3.x hosting.api.php hook_allow_domain($url, $params)

Determine if a site can be created using the specified domain.

The frontend will only create a specified domains if all implementations of this hook return TRUE, so in most cases you will be looking for domains that you don't allow, and fallback to a default position of allowing the domain.

Parameters

string $url: The URL of the site that hosting wishes to create.

array $params: An array of paramters that may contain information about the site. None of the keys are required however, so you should not depend on the value of any particular key in this array. If the array is not empty it will usually contain at least a 'nid' key whose value is the nid of the site being created.

Return value

bool Return TRUE/FALSE if you allow or deny the domain respectively.

See also

hosting_domain_allowed()

Related topics

2 functions implement hook_allow_domain()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

hosting_alias_allow_domain in alias/hosting_alias.module
Implements hook_allow_domain().
hosting_site_allow_domain in site/hosting_site.module
Implements hook_allow_domain().
1 invocation of hook_allow_domain()
hosting_domain_allowed in ./hosting.module
Check site URL is allowed.

File

./hosting.api.php, line 35
Hooks provided by the hosting module, and some other random ones.

Code

function hook_allow_domain($url, $params) {
  // Don't allow another drupal.org, it's special.
  if ($url == 'drupal.org') {
    return FALSE;
  }
  else {
    return TRUE;
  }
}