}
}
-/// Run the enrolment cron, if any
- if (!($plugins = explode(',', $CFG->enrol_plugins_enabled))) {
- $plugins = array($CFG->enrol);
- }
- require_once($CFG->dirroot .'/enrol/enrol.class.php');
- foreach ($plugins as $p) {
- $enrol = enrolment_factory::factory($p);
- if (method_exists($enrol, 'cron')) {
- $enrol->cron();
- }
- if (!empty($enrol->log)) {
- mtrace($enrol->log);
- }
- unset($enrol);
- }
-
/// Run the auth cron, if any
+/// before enrolments because it might add users that will be needed in enrol plugins
$auths = get_enabled_auth_plugins();
mtrace("Running auth crons if required...");
unset($authplugin);
}
+/// Run the enrolment cron, if any
+ if (!($plugins = explode(',', $CFG->enrol_plugins_enabled))) {
+ $plugins = array($CFG->enrol);
+ }
+ require_once($CFG->dirroot .'/enrol/enrol.class.php');
+ foreach ($plugins as $p) {
+ $enrol = enrolment_factory::factory($p);
+ if (method_exists($enrol, 'cron')) {
+ $enrol->cron();
+ }
+ if (!empty($enrol->log)) {
+ mtrace($enrol->log);
+ }
+ unset($enrol);
+ }
+
if (!empty($CFG->enablestats) and empty($CFG->disablestatsprocessing)) {
require_once($CFG->dirroot.'/lib/statslib.php');
// check we're not before our runtime