]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15099 towards enrol dml conversion
authorskodak <skodak>
Thu, 5 Jun 2008 14:18:21 +0000 (14:18 +0000)
committerskodak <skodak>
Thu, 5 Jun 2008 14:18:21 +0000 (14:18 +0000)
enrol/authorize/enrol.php

index ead43b83f8acd492f461c07ba98bc4d2920d4545..4634c91f47368496d8f615c5a6ce82b2f260794a 100755 (executable)
@@ -463,7 +463,7 @@ class enrolment_plugin_authorize
             $captureday = intval($frm->an_capture_day);
             $emailexpired = intval($frm->an_emailexpired);
             if ($captureday > 0 || $emailexpired > 0) {
-                $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
+                $lastcron = $DB->get_field_sql('SELECT max(lastcron) FROM {modules}');
                 if ((time() - intval($lastcron) > 3600 * 24)) {
                     notify(get_string('admincronsetup', 'enrol_authorize'));
                 }
@@ -499,7 +499,7 @@ class enrolment_plugin_authorize
      */
     public function process_config($config)
     {
-        global $CFG;
+        global $CFG, $DB;
         $mconfig = get_config('enrol/authorize');
 
         // site settings
@@ -539,7 +539,7 @@ class enrolment_plugin_authorize
         $emailexpired = ($emailexpired > 5) ? 5 : (($emailexpired < 0) ? 0 : $emailexpired);
 
         if (!empty($reviewval) && ($captureday > 0 || $emailexpired > 0)) {
-            $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
+            $lastcron = $DB->get_field_sql('SELECT max(lastcron) FROM {modules}');
             if (time() - intval($lastcron) > 3600 * 24) {
                 return false;
             }