You are here

function domain_unique_domain in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain.module \domain_unique_domain()
  2. 7.3 domain.module \domain_unique_domain()
  3. 7.2 domain.module \domain_unique_domain()

Validate the domain against existing domains.

Parameters

$subdomain: Domain string to check

Return value

bool TRUE if unique; FALSE if duplicate.

2 calls to domain_unique_domain()
domain_form_validate in ./domain.admin.inc
Implement domain_form validate hook.
domain_validate in ./domain.module
Validates a domain string.

File

./domain.module, line 1092
Core module functions for the Domain Access suite.

Code

function domain_unique_domain($subdomain) {
  $count = db_result(db_query("SELECT 1 FROM {domain} WHERE subdomain = '%s'", $subdomain));
  return !(bool) $count;
}