Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
12923c92
Commit
12923c92
authored
Feb 17, 2011
by
Petr Skoda
Browse files
MDL-26476 fix incorrect fetching of user groups in modinfo
parent
99faefb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/modinfolib.php
View file @
12923c92
...
...
@@ -906,8 +906,8 @@ class cm_info extends stdClass {
}
else
if
(
!
empty
(
$CFG
->
enablegroupmembersonly
)
and
!
empty
(
$this
->
groupmembersonly
)
and
!
has_capability
(
'moodle/site:accessallgroups'
,
$modcontext
,
$userid
))
{
// If the activity has 'group members only' and you don't have accessallgroups...
$groups
=
$this
->
modinfo
->
get_groups
();
if
(
empty
(
$
this
->
groups
[
$this
->
groupingid
]
))
{
$groups
=
$this
->
modinfo
->
get_groups
(
$this
->
groupingid
);
if
(
empty
(
$
groups
))
{
// ...and you don't belong to a group, then set it so you can't see/access it
$this
->
uservisible
=
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment