You are here

function domain_user_domainload in Domain Access 5

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

Implement hook_domainload()

File

domain_user/domain_user.module, line 178
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 INNER JOIN {users} u ON du.uid = u.uid WHERE du.domain_id = %d", $domain['domain_id']));
    if ($data['uid']) {
      $domain['uid'] = $data['uid'];
    }
  }
}