Skip to content

Commit

Permalink
enrol/ldap - fix course auto-creation to work with the new blocks inf…
Browse files Browse the repository at this point in the history
…rastructure. doh! (thanks penny!)
  • Loading branch information
martinlanghoff committed Sep 2, 2005
1 parent 8ade954 commit f159f93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion enrol/ldap/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_once("$CFG->dirroot/enrol/enrol.class.php");
require_once("$CFG->dirroot/course/lib.php");
require_once("$CFG->dirroot/lib/blocklib.php");
require_once("$CFG->dirroot//lib/pagelib.php");

$CFG->enrol_localcoursefield = 'idnumber';

Expand Down Expand Up @@ -568,7 +569,6 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){
$course->teacher = 'Teacher';
$course->teachers = 'Teachers';
$course->format = 'topics';
$course->blockinfo = blocks_get_default();

// override defaults with template course
if(!empty($CFG->enrol_ldap_template)){
Expand Down Expand Up @@ -617,6 +617,9 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){
$section->course = $newcourseid; // Create a default section.
$section->section = 0;
$section->id = insert_record("course_sections", $section);
$page = page_create_object(PAGE_COURSE_VIEW, $newcourseid);
blocks_repopulate_page($page); // Return value no


if(!$skip_fix_course_sortorder){
fix_course_sortorder();
Expand Down

0 comments on commit f159f93

Please sign in to comment.