Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/invite/README.txt,v
retrieving revision 1.4.2.12
diff -u -r1.4.2.12 README.txt
--- README.txt	15 Oct 2007 04:30:28 -0000	1.4.2.12
+++ README.txt	15 Oct 2007 06:04:05 -0000
@@ -33,6 +33,10 @@
   (admin/user/access).
   "send mass invitations": Allows users to send an invitation to multiple
   recipients (this was formerly a setting known as "limit per turn").
+  "view invite statistics": Allows users to view invite statistics on their
+  profile pages as well as view the Top inviters/User rank block.
+  "view own invite statistics": Same as above, but limits viewing statistics to
+  the user's own profile.
   "withdraw accepted invitations": This will allow your users to delete
   accepted invitations. It will also delete all invitations from/to a user upon
   termination of its account. Disable it to prevent users from deleting their
Index: invite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/invite/invite.module,v
retrieving revision 1.10.2.83
diff -u -r1.10.2.83 invite.module
--- invite.module	15 Oct 2007 04:30:28 -0000	1.10.2.83
+++ invite.module	15 Oct 2007 05:59:09 -0000
@@ -57,7 +57,7 @@
  * Implementation of hook_perm().
  */
 function invite_perm() {
-  return array('send invitations', 'send mass invitations', 'withdraw accepted invitations');
+  return array('send invitations', 'send mass invitations', 'withdraw accepted invitations', 'view invite statistics', 'view own invite statistics');
 }
 
 /**
@@ -205,9 +205,12 @@
  * Implementation of hook_user().
  */
 function invite_user($op, &$edit, &$account, $category = NULL) {
+  global $user;
+
   switch ($op) {
     case 'view':
-      if (user_access('send invitations', $account)) {
+      if (user_access('view invite statistics')
+        || ($account->uid == $user->uid && user_access('view own invite statistics'))) {
         $counts = invite_get_counts($account->uid);
         $items['accepted'] = array(
           'title' => t('Successful'),
@@ -282,17 +285,19 @@
         }
         break;
       case 1:
-        if (arg(0) == 'user' && is_numeric(arg(1)) && $account = user_load(array('uid' => arg(1)))) {
-          $block = array(
-            'subject' => t("@user's invite rank", array('@user' => $account->name)),
-            'content' => invite_user_rank($account->uid),
-          );
-        }
-        else {
-          $block = array(
-            'subject' => t('Top inviters'),
-            'content' => invite_top_inviters(),
-          );
+        if (user_access('view invite statistics')) {
+          if (arg(0) == 'user' && is_numeric(arg(1)) && $account = user_load(array('uid' => arg(1)))) {
+            $block = array(
+              'subject' => t("@user's invite rank", array('@user' => $account->name)),
+              'content' => invite_user_rank($account->uid),
+            );
+          }
+          else {
+            $block = array(
+              'subject' => t('Top inviters'),
+              'content' => invite_top_inviters(),
+            );
+          }
         }
         break;
     }

