mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
enrol/ldap: MDL-13952 Don't auto create courses if auto creation not enabled.
Merged from MOODLE_18_STABLE
This commit is contained in:
parent
d804f9e29f
commit
c757ef825b
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user