You are here

function hosting_site_allow_domain in Hostmaster (Aegir) 6

Implementation of hook_allow_domain().

See also

hosting_domain_allowed()

File

modules/hosting/site/hosting_site.module, line 470

Code

function hosting_site_allow_domain($url, $params = array()) {
  $query = "SELECT COUNT(n.nid) FROM {node} n \n    JOIN {hosting_site} h ON n.nid = h.nid\n    WHERE type='site' AND title='%s' AND h.status <> %d ";
  $args[] = $url;
  $args[] = HOSTING_SITE_DELETED;
  if (isset($params['nid'])) {
    $query .= ' AND n.nid <> %d';
    $args[] = $params['nid'];
  }
  $result = !db_result(db_query($query, $args));
  return $result;
}