From: skodak Date: Thu, 26 Mar 2009 19:56:11 +0000 (+0000) Subject: MDL-18676 auth plugins should run before enrol because it may create new users -... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1619d1098f391056ef6ec566d7bf93d568c5c4cb;p=moodle.git MDL-18676 auth plugins should run before enrol because it may create new users - proposed by Jason Hardin --- diff --git a/admin/cron.php b/admin/cron.php index fa15f56b21..a06ad3d824 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -452,23 +452,8 @@ } } -/// 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..."); @@ -484,6 +469,22 @@ 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