You are here

function profile_category_access in Drupal 6

Same name and namespace in other branches
  1. 7 modules/profile/profile.module \profile_category_access()

Menu item access callback - check if a user has access to a profile category.

1 string reference to 'profile_category_access'
profile_categories in modules/profile/profile.module

File

modules/profile/profile.module, line 468
Support for configurable user profiles.

Code

function profile_category_access($account, $category) {
  if (user_access('administer users') && $account->uid > 0) {
    return TRUE;
  }
  else {
    return user_edit_access($account) && db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE category = '%s' AND visibility <> %d", $category, PROFILE_HIDDEN));
  }
}