? _60483_comment_tab.patch
? files
? latest.html
? modules/api
? modules/devel
? modules/game
? sites/feast-or-fa.mine.nu.drupal
Index: modules/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact.module,v
retrieving revision 1.51
diff -u -p -r1.51 contact.module
--- modules/contact.module	17 Apr 2006 20:48:26 -0000	1.51
+++ modules/contact.module	26 Apr 2006 13:37:57 -0000
@@ -95,12 +95,16 @@ function contact_menu($may_cache) {
   }
   else {
     if (arg(0) == 'user' && is_numeric(arg(1))) {
-      $items[] = array('path' => "user/". arg(1) ."/contact",
-        'title' => t('contact'),
-        'callback' => 'contact_mail_user',
-        'type' => MENU_LOCAL_TASK,
-        'weight' => 2,
-      );
+      $user = user_load(array('uid' => arg(1)));
+      if ($user->contact) { // show tab only if enabled.
+        $items[] = array('path' => "user/". arg(1) ."/contact",
+          'title' => t('contact'),
+          'callback' => 'contact_mail_user',
+          'type' => MENU_LOCAL_TASK,
+          'access' => $user->contact,
+          'weight' => 2,
+        );
+      }
     }
   }
 
@@ -304,9 +308,6 @@ function contact_mail_user() {
     if (!$account->status && !$admin_access) {
       drupal_access_denied();
     }
-    else if (!$account->contact && !$admin_access) {
-      $output = t('%name is not accepting e-mails.', array('%name' => $account->name));
-    }
     else if (!$user->uid) {
       $output = t('Please <a href="%login">login</a> or <a href="%register">register</a> to send %name a message.', array('%login' => url('user/login'), '%register' => url('user/register'), '%name' => $account->name));
     }
