/// sync enrolments with database, create courses if required.
///
/// NOTE: we are currently ignoring $type, as enrol/database only deasl with student enrolment
+///
+/// This function still needs to be converted to Roles! XXX TODO
+///
function sync_enrolments($type='student') {
global $CFG;
global $db;
require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.
require_once($CFG->dirroot . '/course/lib.php');
- require_once($CFG->dirroot . '/lib/moodlelib.php');
- require_once($CFG->dirroot . '/lib/datalib.php');
require_once($CFG->dirroot . "/enrol/" . $CFG->enrol . "/enrol.php");
// ensure errors are well explained