profile_category_access
- Versions
- 6 – 7
profile_category_access($account, $category)
Menu item access callback - check if a user has access to a profile category.
Code
modules/profile/profile.module, line 511
<?php
function profile_category_access($account, $category) {
if (user_access('administer users') && $account->uid > 0) {
return TRUE;
}
else {
$category_visible = (bool) db_query_range('SELECT 1 FROM {profile_field} WHERE category = :category AND visibility <> :visibility', 0, 1, array(
':category' => $category,
':visibility' => PROFILE_HIDDEN
))->fetchField();
return user_edit_access($account) && $category_visible;
}
}
?>Login or register to post comments 