You are here

function linkedin_profile_display_access in LinkedIn Integration 6

Same name and namespace in other branches
  1. 7 linkedin_profile/linkedin_profile.module \linkedin_profile_display_access()
2 calls to linkedin_profile_display_access()
linkedin_profile_block in linkedin_profile/linkedin_profile.module
linkedin_profile_user in linkedin_profile/linkedin_profile.module
1 string reference to 'linkedin_profile_display_access'
linkedin_profile_menu in linkedin_profile/linkedin_profile.module

File

linkedin_profile/linkedin_profile.module, line 47
Main hooks implementation for LinkedIn Profile module

Code

function linkedin_profile_display_access($account) {
  global $user;
  if (variable_get('linkedin_profile_user_page_enabled', '0') < '1' || !user_access('display LinkedIn profile', $account) || $account->linkedin_profile_user_page_enabled != '1') {
    return FALSE;
  }
  if (!user_access('access user profiles') && $user->uid != $account->uid) {
    return FALSE;
  }
  module_load_include('inc', 'linkedin', 'linkedin');
  $check = linkedin_get_profile_fields($account->uid, array(
    'id',
  ));
  if ($check['error-code']) {

    // no need to display an empty tab
    return FALSE;
  }
  return TRUE;
}