From: Inaki Date: Wed, 4 Nov 2009 21:00:58 +0000 (+0000) Subject: enrol/ldap: MDL-13952 Don't auto create courses if auto creation not enabled. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c757ef825bd469e0a292c509f3ff9883d559fef7;p=moodle.git enrol/ldap: MDL-13952 Don't auto create courses if auto creation not enabled. Merged from MOODLE_18_STABLE --- diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php index 1b3fde09f2..9b9c56dc56 100755 --- a/enrol/ldap/enrol.php +++ b/enrol/ldap/enrol.php @@ -210,6 +210,11 @@ function sync_enrolments($type, $enrol = false) { $course_obj = false; $course_obj = $DB->get_record('course', array($this->enrol_localcoursefield=>$idnumber)); if (!is_object($course_obj)) { + if (empty($CFG->enrol_ldap_autocreate)) { // autocreation not allowed + print "[ENROL_LDAP] Course $idnumber does not exist, skipping\n"; + continue; // next foreach course + } + // ok, now then let's create it! print "Creating Course $idnumber..."; $newcourseid = $this->create_course($course, true); // we are skipping fix_course_sortorder()