MDL-26221 add missing course/lib.php include when using make_categories_list()
authorPetr Skoda <commits@skodak.org>
Sun, 6 Feb 2011 16:58:47 +0000 (17:58 +0100)
committerPetr Skoda <commits@skodak.org>
Sun, 6 Feb 2011 16:58:47 +0000 (17:58 +0100)
enrol/database/settings.php
enrol/ldap/settings.php
user/filters/courserole.php

index 0fb9e28..8e85f9b 100644 (file)
@@ -108,6 +108,7 @@ if ($ADMIN->fulltree) {
     $settings->add(new admin_setting_configtext('enrol_database/newcoursecategory', get_string('newcoursecategory', 'enrol_database'), '', ''));
 
     if (!during_initial_install()) {
+        require_once($CFG->dirroot.'/course/lib.php');
         $options = array();
         $parentlist = array();
         make_categories_list($options, $parentlist);
index 85dc17a..edd0217 100644 (file)
@@ -92,6 +92,7 @@ if ($ADMIN->fulltree) {
         $options = $yesno;
         $settings->add(new admin_setting_configselect('enrol_ldap/autocreate', get_string('autocreate_key', 'enrol_ldap'), get_string('autocreate', 'enrol_ldap'), 0, $options));
         if (!during_initial_install()) {
+            require_once($CFG->dirroot.'/course/lib.php');
             $parentlist = array();
             $options = array();
             make_categories_list($options, $parentlist);
index 55fee3c..e8172ec 100644 (file)
@@ -31,6 +31,8 @@ class user_filter_courserole extends user_filter_type {
      * @return array of course categories
      */
     function get_course_categories() {
+        global $CFG;
+        require_once($CFG->dirroot.'/course/lib.php');
         $displaylist = array();
         $parentlist = array();
         make_categories_list($displaylist, $parentlist);