summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-10-08 06:09:41 +0000
committerDries Buytaert <dries@buytaert.net>2006-10-08 06:09:41 +0000
commit8f535993ed9ba3a82b7c7c694439c66107295f66 (patch)
tree28a7658c7509c3c7784248e57d1cc3b2b0beec86
parent14e925e36a7525533119ce880921e670c0f7261e (diff)
downloadbrdo-8f535993ed9ba3a82b7c7c694439c66107295f66.tar.gz
brdo-8f535993ed9ba3a82b7c7c694439c66107295f66.tar.bz2
- Patch #69202 by AjK, dopry, chx et al: don't allow anonymous users to send
themselves a copy. Prevents spam.
-rw-r--r--modules/contact/contact.module14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 573dbc6b2..f0a7b60cb 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -40,7 +40,7 @@ function contact_help($section) {
* Implementation of hook_perm
*/
function contact_perm() {
- return array('access site-wide contact form', 'access personal contact forms');
+ return array('access site-wide contact form');
}
/**
* Implementation of hook_menu().
@@ -106,7 +106,7 @@ function contact_menu($may_cache) {
'title' => t('contact'),
'callback' => 'contact_user_page',
'type' => MENU_LOCAL_TASK,
- 'access' => ($user->uid && user_access('access personal contact forms')),
+ 'access' => $user->uid,
'weight' => 2,
);
}
@@ -475,9 +475,13 @@ function contact_mail_page() {
'#title' => t('Message'),
'#required' => TRUE,
);
- $form['copy'] = array('#type' => 'checkbox',
- '#title' => t('Send yourself a copy.'),
- );
+ // We do not allow anonymous users to send themselves a copy
+ // because it can be abused to spam people.
+ if ($user->uid) {
+ $form['copy'] = array('#type' => 'checkbox',
+ '#title' => t('Send yourself a copy.'),
+ );
+ }
$form['submit'] = array('#type' => 'submit',
'#value' => t('Send e-mail'),
);