mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 07:39:54 +02:00
Merge branch 'MDL-41259_master' of https://github.com/nitzo/moodle
This commit is contained in:
commit
c932a4db7c
2 changed files with 7 additions and 0 deletions
|
@ -53,6 +53,7 @@ $string['course_summary_key'] = 'Summary';
|
|||
$string['createcourseextid'] = 'CREATE User enrolled to a nonexistant course \'{$a->courseextid}\'';
|
||||
$string['createnotcourseextid'] = 'User enrolled to a nonexistant course \'{$a->courseextid}\'';
|
||||
$string['creatingcourse'] = 'Creating course \'{$a}\'...';
|
||||
$string['duplicateshortname'] = "Course creation failed. Duplicate short name. Skipping course with idnumber '{\$a->idnumber}'...";
|
||||
$string['editlock'] = 'Lock value';
|
||||
$string['emptyenrolment'] = "Empty enrolment for role '{\$a->role_shortname}' in course '{\$a->course_shortname}'\n";
|
||||
$string['enrolname'] = 'LDAP';
|
||||
|
|
|
@ -990,6 +990,12 @@ class enrol_ldap_plugin extends enrol_plugin {
|
|||
$course->summary = $course_ext[$this->get_config('course_summary')][0];
|
||||
}
|
||||
|
||||
// Check if the shortname already exists if it does - skip course creation.
|
||||
if ($DB->record_exists('course', array('shortname' => $course->shortname))) {
|
||||
$trace->output(get_string('duplicateshortname', 'enrol_ldap', $course));
|
||||
return false;
|
||||
}
|
||||
|
||||
$newcourse = create_course($course);
|
||||
return $newcourse->id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue