function shoutbox_domain_is_assigned_domain in Shoutbox 7
Same name and namespace in other branches
- 7.2 shoutbox_domain/shoutbox_domain.module \shoutbox_domain_is_assigned_domain()
Check if the current domain is assigned to the current user.
Statically cached because this only applies to the current domain and the current user.
Return value
Boolean - is assigned or not assigned.
2 calls to shoutbox_domain_is_assigned_domain()
- shoutbox_domain_block_view_alter in shoutbox_domain/
shoutbox_domain.module - Implements hook_block_view_alter().
- shoutbox_domain_shoutbox_user_access_alter in shoutbox_domain/
shoutbox_domain.module - Implements hook_shoutbox_user_access_alter().
File
- shoutbox_domain/
shoutbox_domain.module, line 132
Code
function shoutbox_domain_is_assigned_domain() {
$is_assigned =& drupal_static(__FUNCTION__);
if (isset($is_assigned)) {
return $is_assigned;
}
global $user;
$_domain = domain_get_domain();
// Ensure user domains have been loaded fully in the user object.
domain_user_set($user);
$is_assigned = !empty($user->domain_user[$_domain['domain_id']]);
return $is_assigned;
}