function _domain_user_list in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain.module \_domain_user_list()
- 7.2 domain.module \_domain_user_list()
Helper function to get the names of all domains for a user.
Parameters
$uid: The user id.
Return value
An array of domain names.
1 call to _domain_user_list()
- domain_form_user_admin_account_alter in ./
domain.module - Implement hook_form_alter().
File
- ./
domain.module, line 671 - Core module functions for the Domain Access suite.
Code
function _domain_user_list($uid) {
$temp_account = new stdClass();
$temp_account->uid = $uid;
$list = domain_get_user_domains($temp_account, FALSE);
$domains = array();
foreach ($list as $domain_id) {
if ($domain_id == -1) {
$domain_id = 0;
}
$domains[] = check_plain(db_result(db_query("SELECT sitename FROM {domain} WHERE domain_id = %d ORDER BY domain_id ASC", $domain_id)));
}
return $domains;
}