summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/contact.module12
-rw-r--r--modules/contact/contact.module12
2 files changed, 20 insertions, 4 deletions
diff --git a/modules/contact.module b/modules/contact.module
index 48f97137a..07bcd9553 100644
--- a/modules/contact.module
+++ b/modules/contact.module
@@ -38,6 +38,12 @@ function contact_help($section) {
}
/**
+ * Implementation of hook_perm
+ */
+function contact_perm() {
+ return array('access site-wide contact form', 'access personal contact forms');
+}
+/**
* Implementation of hook_menu().
*/
function contact_menu($may_cache) {
@@ -89,16 +95,18 @@ function contact_menu($may_cache) {
$items[] = array('path' => 'contact',
'title' => t('contact'),
'callback' => 'contact_mail_page',
- 'access' => user_access('access content'),
+ 'access' => user_access('access site-wide contact form'),
'type' => MENU_SUGGESTED_ITEM,
);
}
else {
if (arg(0) == 'user' && is_numeric(arg(1))) {
- $items[] = array('path' => "user/". arg(1) ."/contact",
+ global $user;
+ $items[] = array('path' => 'user/'. arg(1) .'/contact',
'title' => t('contact'),
'callback' => 'contact_mail_user',
'type' => MENU_LOCAL_TASK,
+ 'access' => ($user->uid && user_access('access personal contact forms')),
'weight' => 2,
);
}
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 48f97137a..07bcd9553 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -38,6 +38,12 @@ function contact_help($section) {
}
/**
+ * Implementation of hook_perm
+ */
+function contact_perm() {
+ return array('access site-wide contact form', 'access personal contact forms');
+}
+/**
* Implementation of hook_menu().
*/
function contact_menu($may_cache) {
@@ -89,16 +95,18 @@ function contact_menu($may_cache) {
$items[] = array('path' => 'contact',
'title' => t('contact'),
'callback' => 'contact_mail_page',
- 'access' => user_access('access content'),
+ 'access' => user_access('access site-wide contact form'),
'type' => MENU_SUGGESTED_ITEM,
);
}
else {
if (arg(0) == 'user' && is_numeric(arg(1))) {
- $items[] = array('path' => "user/". arg(1) ."/contact",
+ global $user;
+ $items[] = array('path' => 'user/'. arg(1) .'/contact',
'title' => t('contact'),
'callback' => 'contact_mail_user',
'type' => MENU_LOCAL_TASK,
+ 'access' => ($user->uid && user_access('access personal contact forms')),
'weight' => 2,
);
}