Index: sites/all/modules/userpoints/userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.module,v
retrieving revision 1.67.2.48
diff -u -r1.67.2.48 userpoints.module
--- sites/all/modules/userpoints/userpoints.module	21 Oct 2009 17:55:23 -0000	1.67.2.48
+++ sites/all/modules/userpoints/userpoints.module	28 Oct 2009 12:24:29 -0000
@@ -159,11 +159,11 @@
   );
   
   $items['myuserpoints'] = array(
-    'title'           => 'My !points',
-    'title arguments' => userpoints_translation(),
-    'page callback'   => 'userpoints_list_my_userpoints',
-    'access callback' => 'userpoints_access_my_points',
-    'type'            => MENU_NORMAL_ITEM
+    'title'            => 'My !points',
+    'title arguments'  => userpoints_translation(),
+    'page callback'    => 'userpoints_list_my_userpoints',
+    'access callback'  => 'userpoints_access_my_points',
+    'type'             => MENU_NORMAL_ITEM
   );
   return $items;
 }
@@ -175,12 +175,17 @@
  */
 function userpoints_access_my_points() {
   global $user;
-  if ($user->uid === 1 || user_access('USERPOINTS_PERM_ADMIN')) {
-    return TRUE;
+  
+  if ($user->uid === 1 || user_access(USERPOINTS_PERM_ADMIN)) {
+		return TRUE;
+  }
+
+  $uid = (int)arg(1);  
+	if($uid && $uid != $user->uid && !user_access(USERPOINTS_PERM_VIEW)) {
+		return FALSE;
   }
-  return ( _userpoints_user_exists($user->uid) && 
-					((user_access(USERPOINTS_PERM_VIEW) && user_is_logged_in()) || user_access(USERPOINTS_PERM_VIEW_OWN)) 
-				 );
+
+  return (_userpoints_user_exists($user->uid) && (user_is_logged_in() && user_access(USERPOINTS_PERM_VIEW_OWN)));
 }
 
 /**
@@ -1671,31 +1676,13 @@
 
   // User which are displaying points for
   $uid = (int)arg(1);
-  if ($uid) {
-    if ($uid != $user->uid) {
-      // If not the same as logged in user
-		  drupal_access_denied();
-      return;
-    }
-  }
-  else {
+  
+  if (!$uid){
     // Default to currently logged in user
     $uid = $user->uid;
   }
-  $point_user = user_load(array('uid' => $uid));
-
-  // Check permissions
-  if(!user_access(USERPOINTS_PERM_VIEW)) {
-    // User has no access to view points
-		drupal_access_denied();
-    return;
-  }
-
-  if (!user_access(USERPOINTS_PERM_VIEW_OWN)) {
-    // User has no access to view own points
-		drupal_access_denied();
-    return;
-  } 
+  
+  $point_user = user_load(array('uid' => $uid)); 
 		
   $title = t('!Points for ', userpoints_translation()) . check_plain($point_user->name);
   drupal_set_title($title);
