Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-12433: course/info respect the $CFG->allowvisiblecoursesinhiddenc…

…ategories setting

Credit goes to Petr Kalis
  • Loading branch information...
commit 2d5b1ac89131fdaf948b15f2af0087b7c3446a75 1 parent df825b9
mattc-catalyst authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 course/info.php
View
5 course/info.php
@@ -28,7 +28,8 @@
require_login();
}
- if (!(course_parent_visible($course) || $course->visible) && !has_capability('moodle/course:viewhiddencourses', $context)) {
+ $context = get_context_instance(CONTEXT_COURSE, $course->id);
+ if ((!(course_parent_visible($course) && $CFG->allowvisiblecoursesinhiddencategories) || (! $course->visible)) && !has_capability('moodle/course:viewhiddencourses', $context)) {
error(get_string('coursehidden'), $CFG->wwwroot .'/');
}
@@ -54,7 +55,7 @@
echo filter_text(text_to_html($course->summary),$course->id);
- $context = get_context_instance(CONTEXT_COURSE, $course->id);
+
if ($managerroles = get_config('', 'coursemanager')) {
$coursemanagerroles = split(',', $managerroles);
foreach ($coursemanagerroles as $roleid) {
Please sign in to comment.
Something went wrong with that request. Please try again.