function userpoints_access_my_points in User Points 6
Same name and namespace in other branches
- 7.2 userpoints.module \userpoints_access_my_points()
- 7 userpoints.module \userpoints_access_my_points()
Checks if user can access their points - used via hook_menu().
Return value
TRUE if user has permissions to view userpoints and if the user is logged in.
1 call to userpoints_access_my_points()
1 string reference to 'userpoints_access_my_points'
- userpoints_menu in ./
userpoints.module - Implementation of hook_menu().
File
- ./
userpoints.module, line 187
Code
function userpoints_access_my_points($account = NULL) {
global $user;
if ($account && $user->uid != $account->uid) {
return user_access(USERPOINTS_PERM_ADMIN);
}
return user_access(USERPOINTS_PERM_VIEW) && user_is_logged_in() || user_access(USERPOINTS_PERM_VIEW_OWN);
}