You are here

function domain_user_domainload in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain_user/domain_user.module \domain_user_domainload()

Implement hook_domainload()

File

domain_user/domain_user.module, line 113
Creates unique subdomains for registered users.

Code

function domain_user_domainload(&$domain) {

  // Zero is the default domain, and we don't want to invalidate it.
  if ($domain['domain_id'] > 0) {
    $data = db_fetch_array(db_query("SELECT du.uid, u.status FROM {domain_user} du\n      INNER JOIN {users} u ON du.uid = u.uid\n      WHERE du.domain_id = %d", $domain['domain_id']));
    if ($data['uid']) {
      $domain['uid'] = $data['uid'];
    }
  }
}