Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
8f535993
Commit
8f535993
authored
18 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#69202
by AjK, dopry, chx et al: don't allow anonymous users to send
themselves a copy. Prevents spam.
parent
14e925e3
Loading
Loading
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/contact/contact.module
+9
-5
9 additions, 5 deletions
modules/contact/contact.module
with
9 additions
and
5 deletions
modules/contact/contact.module
+
9
−
5
View file @
8f535993
...
@@ -40,7 +40,7 @@ function contact_help($section) {
...
@@ -40,7 +40,7 @@ function contact_help($section) {
* Implementation of hook_perm
* Implementation of hook_perm
*/
*/
function
contact_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().
* Implementation of hook_menu().
...
@@ -106,7 +106,7 @@ function contact_menu($may_cache) {
...
@@ -106,7 +106,7 @@ function contact_menu($may_cache) {
'title'
=>
t
(
'contact'
),
'title'
=>
t
(
'contact'
),
'callback'
=>
'contact_user_page'
,
'callback'
=>
'contact_user_page'
,
'type'
=>
MENU_LOCAL_TASK
,
'type'
=>
MENU_LOCAL_TASK
,
'access'
=>
(
$user
->
uid
&&
user_access
(
'access personal contact forms'
))
,
'access'
=>
$user
->
uid
,
'weight'
=>
2
,
'weight'
=>
2
,
);
);
}
}
...
@@ -475,9 +475,13 @@ function contact_mail_page() {
...
@@ -475,9 +475,13 @@ function contact_mail_page() {
'#title'
=>
t
(
'Message'
),
'#title'
=>
t
(
'Message'
),
'#required'
=>
TRUE
,
'#required'
=>
TRUE
,
);
);
$form
[
'copy'
]
=
array
(
'#type'
=>
'checkbox'
,
// We do not allow anonymous users to send themselves a copy
'#title'
=>
t
(
'Send yourself 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'
,
$form
[
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Send e-mail'
),
'#value'
=>
t
(
'Send e-mail'
),
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment