You are here

function _biblio_profile_access in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 biblio.module \_biblio_profile_access()
  2. 7 biblio.module \_biblio_profile_access()
  3. 7.2 biblio.module \_biblio_profile_access()
1 string reference to '_biblio_profile_access'
biblio_menu in ./biblio.module
Implementation of hook_menu().

File

./biblio.module, line 2381

Code

function _biblio_profile_access($user, $type = 'profile') {
  if ($type == 'profile') {
    $key = 'biblio_show_profile';
  }
  else {
    if ($type == 'menu' && $user->uid > 0) {
      $key = 'biblio_my_pubs_menu';
    }
    else {
      return false;
    }
  }

  // if user cannot override site settings or user hasn't yet made its selection, we use site default
  if (!variable_get('biblio_show_user_profile_form', '1') || !isset($user->{$key})) {
    return variable_get($key, '0');
  }
  else {
    return $user->{$key};
  }

  // return user setting
}