mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
Patched file. Bug 1425 closed.
(http://moodle.org/bugs/bug.php?op=show&bugid=1425)
This commit is contained in:
parent
52b201eeb5
commit
4b92953150
@ -1628,13 +1628,17 @@ function get_courses($categoryid="all", $sort="c.sortorder ASC", $fields="c.*")
|
||||
|
||||
$teachertable = "";
|
||||
$visiblecourses = "";
|
||||
$sqland = "";
|
||||
if (!empty($categoryselect)) {
|
||||
$sqland = "AND ";
|
||||
}
|
||||
if (!empty($USER)) { // May need to check they are a teacher
|
||||
if (!iscreator()) {
|
||||
$visiblecourses = "AND ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
|
||||
$visiblecourses = "$sqland ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
|
||||
$teachertable = ", {$CFG->prefix}user_teachers t";
|
||||
}
|
||||
} else {
|
||||
$visiblecourses = "AND c.visible > 0";
|
||||
$visiblecourses = "$sqland c.visible > 0";
|
||||
}
|
||||
|
||||
if ($categoryselect or $visiblecourses) {
|
||||
@ -1667,13 +1671,17 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c
|
||||
|
||||
$teachertable = "";
|
||||
$visiblecourses = "";
|
||||
$sqland = "";
|
||||
if (!empty($categoryselect)) {
|
||||
$sqland = "AND ";
|
||||
}
|
||||
if (!empty($USER)) { // May need to check they are a teacher
|
||||
if (!iscreator()) {
|
||||
$visiblecourses = "AND ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
|
||||
$visiblecourses = "$sqland ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
|
||||
$teachertable = ", {$CFG->prefix}user_teachers t";
|
||||
}
|
||||
} else {
|
||||
$visiblecourses = "AND c.visible > 0";
|
||||
$visiblecourses = "$sqland c.visible > 0";
|
||||
}
|
||||
|
||||
if ($limitfrom !== "") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user