Browse files

enrol/ldap: MDL-13952 Don't auto create courses if auto creation not …

…enabled.

Merged from MOODLE_18_STABLE
  • Loading branch information...
1 parent b78d7c8 commit a025a96009842319a5386a348ff6df791d8acbc2 @iarenaza iarenaza committed Nov 4, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 enrol/ldap/enrol.php
View
5 enrol/ldap/enrol.php
@@ -214,6 +214,11 @@ function sync_enrolments($type, $enrol = false) {
$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()

0 comments on commit a025a96

Please sign in to comment.