function user_view_access
Same name and namespace in other branches
- 6.x drupal-6.x/modules/user/user.module \user_view_access()
User view access callback.
Parameters
$account: Can either be a full user object or a $uid.
2 calls to user_view_access()
- user_file_download_access in drupal-7.x/
modules/ user/ user.module - Implements hook_file_download_access().
- _tracker_user_access in drupal-7.x/
modules/ tracker/ tracker.module - Access callback for user/%user/track.
3 string references to 'user_view_access'
- drupal-6.bare.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.bare.database.php - Bare installation of Drupal 6.17, for test purposes.
- drupal-6.filled.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.filled.database.php - Filled installation of Drupal 6.17, for test purposes.
- user_menu in drupal-7.x/
modules/ user/ user.module - Implements hook_menu().
Archivo
- drupal-7.x/
modules/ user/ user.module, line 1564 - Enables the user registration and login system.
Código
function user_view_access($account) {
$uid = is_object($account) ? $account->uid : (int) $account;
// Never allow access to view the anonymous user account.
if ($uid) {
// Admins can view all, users can view own profiles at all times.
if ($GLOBALS['user']->uid == $uid || user_access('administer users')) {
return TRUE;
}
elseif (user_access('access user profiles')) {
// At this point, load the complete account object.
if (!is_object($account)) {
$account = user_load($uid);
}
return (is_object($account) && $account->status);
}
}
return FALSE;
}