Skip to content
Sign up
Sign in
This repository
Explore
Features
Enterprise
Pricing
Watch
60
Star
171
Fork
142
SimpleMachines
/
SMF2.1
Code
Issues
Pull requests
Wiki
Pulse
Graphs
HTTPS
clone URL
Subversion
checkout URL
You can clone with
HTTPS
or
Subversion
.
Download ZIP
Permalink
Browse files
Merge pull request
#2999
from ElTrolado/release-2.1
Fix PMs permission checking
release-2.1
commit
f0bb3b74374ae04fcc27018bbb2be41ccc81ea61
2 parents
25be8ec
+
05b4b36
live627
authored
Aug 22, 2015
Unified
Split
Showing
1 changed file
with
3 additions
and
3 deletions
.
+3
−3
Sources/Subs-Post.php
Show notes
View
6
Sources/Subs-Post.php
@@ -922,10 +922,10 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
// Load the groups that are allowed to read PMs.
require_once
(
$sourcedir
.
'
/Subs-Members.php
'
);
-
list
(
$allowed_groups
,
$disallowed_groups
)
=
groupsAllowedTo(
'
pm_read
'
);
+
$pmReadGroups
=
groupsAllowedTo(
'
pm_read
'
);
if
(
empty
(
$modSettings
[
'
permission_enable_deny
'
]))
-
$
disallowed_groups
=
array
();
+
$
pmReadGroups
[
'
denied
'
]
=
array
();
// Load their alert preferences
require_once
(
$sourcedir
.
'
/Subs-Notify.php
'
);
@@ -991,7 +991,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
}
// Do they have any of the allowed groups?
-
if
(
count
(
array_intersect
(
$
allowed_groups
,
$groups
))
==
0
||
count
(
array_intersect
(
$
disallowed_groups
,
$groups
))
!
=
0
)
+
if
(
count
(
array_intersect
(
$
pmReadGroups
[
'
allowed
'
]
,
$groups
))
==
0
||
count
(
array_intersect
(
$
pmReadGroups
[
'
denied
'
]
,
$groups
))
!
=
0
)
{
$log
[
'
failed
'
][
$row
[
'
id_member
'
]]
=
sprintf
(
$txt
[
'
pm_error_user_cannot_read
'
],
$row
[
'
real_name
'
]);
unset
(
$all_to
[
array_search
(
$row
[
'
id_member
'
],
$all_to
)]);
Toggle all file notes
Please
sign in
to comment.
Something went wrong with that request. Please try again.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.