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
08563b46
Commit
08563b46
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#586664
by bleen18: Fixed Users should not be able to contact blocked users (with tests).
parent
2d4b5d08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/contact/contact.module
+5
-0
5 additions, 0 deletions
modules/contact/contact.module
modules/contact/contact.test
+13
-0
13 additions, 0 deletions
modules/contact/contact.test
with
18 additions
and
0 deletions
modules/contact/contact.module
+
5
−
0
View file @
08563b46
...
...
@@ -142,6 +142,11 @@ function _contact_personal_tab_access(stdClass $account) {
return
FALSE
;
}
// If requested user has been blocked, do not allow users to contact them.
if
(
empty
(
$account
->
status
))
{
return
FALSE
;
}
return
user_access
(
'access user contact forms'
);
}
...
...
This diff is collapsed.
Click to expand it.
modules/contact/contact.test
+
13
−
0
View file @
08563b46
...
...
@@ -352,6 +352,19 @@ class ContactPersonalTestCase extends DrupalWebTestCase {
$this
->
drupalLogin
(
$this
->
admin_user
);
$this
->
drupalGet
(
'user/'
.
$this
->
contact_user
->
uid
.
'/contact'
);
$this
->
assertResponse
(
200
);
// Re-create our contacted user as a blocked user.
$this
->
contact_user
=
$this
->
drupalCreateUser
();
user_save
(
$this
->
contact_user
,
array
(
'status'
=>
0
));
// Test that blocked users can still be contacted by admin.
$this
->
drupalGet
(
'user/'
.
$this
->
contact_user
->
uid
.
'/contact'
);
$this
->
assertResponse
(
200
);
// Test that blocked users cannot be contacted by non-admins.
$this
->
drupalLogin
(
$this
->
web_user
);
$this
->
drupalGet
(
'user/'
.
$this
->
contact_user
->
uid
.
'/contact'
);
$this
->
assertResponse
(
403
);
}
/**
...
...
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