merged fix for MDL-8885, teachers should not be able to set course as hidden if they can not view hidden courses

This commit is contained in:
toyomoyo 2007-03-14 04:31:04 +00:00
parent 7563c86771
commit cbc943f755

View file

@ -330,7 +330,8 @@
'<img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$strdelete.'" /></a> ';
}
if (has_capability('moodle/course:visibility', $coursecontext)) {
// MDL-8885, users with no capability to view hidden courses, should not be able to lock themselves out
if (has_capability('moodle/course:visibility', $coursecontext) && has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
if (!empty($acourse->visible)) {
echo '<a title="'.$strhide.'" href="category.php?id='.$category->id.'&amp;page='.$page.
'&amp;perpage='.$perpage.'&amp;hide='.$acourse->id.'&amp;sesskey='.$USER->sesskey.'">'.