]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-8885, teachers should not be able to set course as hidden if they...
authortoyomoyo <toyomoyo>
Wed, 14 Mar 2007 04:31:04 +0000 (04:31 +0000)
committertoyomoyo <toyomoyo>
Wed, 14 Mar 2007 04:31:04 +0000 (04:31 +0000)
course/category.php

index 09215d0accf285801bc2eb248903123a49a81fdb..9770e0899280d015290ea8e4cb37636d5a5b993b 100644 (file)
                             '<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.'">'.