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
20e9dac8
Commit
20e9dac8
authored
May 04, 2016
by
Andrew Nicols
Browse files
MDL-53589 badges: Correct context
parent
71c7374d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/badgeslib.php
View file @
20e9dac8
...
...
@@ -1141,12 +1141,7 @@ function profile_display_badges($userid, $courseid = 0) {
global
$CFG
,
$PAGE
,
$USER
,
$SITE
;
require_once
(
$CFG
->
dirroot
.
'/badges/renderer.php'
);
// Determine context.
if
(
isloggedin
())
{
$context
=
context_user
::
instance
(
$USER
->
id
);
}
else
{
$context
=
context_system
::
instance
();
}
$context
=
context_user
::
instance
(
$userid
);
if
(
$USER
->
id
==
$userid
||
has_capability
(
'moodle/badges:viewotherbadges'
,
$context
))
{
$records
=
badges_get_user_badges
(
$userid
,
$courseid
,
null
,
null
,
null
,
true
);
...
...
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