mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
merged fix for MDL-9337, hidden teachers are visible when not enroled
This commit is contained in:
parent
e513826187
commit
75c2ecc88e
@ -4,10 +4,10 @@
|
||||
|
||||
print_box_start('generalbox centerpara');
|
||||
echo '<p align="center">';
|
||||
if ($teacher) {
|
||||
if (!empty($teacher)) {
|
||||
$teachername = "<a href=\"../user/view.php?id=$teacher->id&course=".SITEID."\">".fullname($teacher)."</a>.";
|
||||
} else {
|
||||
$teachername = get_string('yourteacher', '', $course->teacher);
|
||||
$teachername = get_string('defaultcourseteacher'); //get_string('yourteacher', '', $course->teacher);
|
||||
}
|
||||
print_string('enrolmentkeyfrom', '', $teachername);
|
||||
?>
|
||||
|
@ -95,8 +95,13 @@ function print_entry($course) {
|
||||
redirect($destination);
|
||||
}
|
||||
}
|
||||
|
||||
$teacher = get_teacher($course->id);
|
||||
|
||||
if ($teachers = get_users_by_capability(get_context_instance(CONTEXT_COURSE, $course->id), 'moodle/course:update',
|
||||
'u.*,ra.hidden', 'r.sortorder ASC',
|
||||
0, 1, '', '', false, true)) {
|
||||
$teacher = array_shift($teachers);
|
||||
}
|
||||
|
||||
if (!isset($password)) {
|
||||
$password = '';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user