Skip to content

Commit

Permalink
enrol/ldap: MDL-13952 Don't auto create courses if auto creation not …
Browse files Browse the repository at this point in the history
…enabled.

Merged from MOODLE_18_STABLE
  • Loading branch information
iarenaza committed Nov 4, 2009
1 parent d804f9e commit c757ef8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enrol/ldap/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c757ef8

Please sign in to comment.