]> git.mjollnir.org Git - moodle.git/commitdiff
enrol/manual: Fix calls to get_users_by_capability() to avoid ra
authormartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:25:15 +0000 (23:25 +0000)
committermartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:25:15 +0000 (23:25 +0000)
get_users_by_capability() can no longer refer to properties of role
assignments or roles, as the capability aggregate is indirect.

MDL-12452

enrol/manual/enrol.php

index 1f97c66fae1b37095525331060e3e47a4e71e534..b25a2492f1c7e27d244a9541c2acacaea9353e4a 100644 (file)
@@ -315,7 +315,7 @@ function cron() {
 
                 if ($a->current || $a->past) {
                     if ($teachers = get_users_by_capability($context, 'moodle/course:update',
-                                                            'u.*,ra.hidden', 'r.sortorder ASC',
+                                                            'u.*', 'u.username ASC',
                                                             '', '', '', '', false)) {
                         foreach ($teachers as $teacher) {
                             email_to_user($teacher, $admin, $a->coursename .' '. $strexpirynotify, $strexpirynotifyemail);
@@ -395,7 +395,7 @@ function print_enrolmentkeyfrom($course) {
     // (show the first person with update rights)
     if (!$contactslisted) {
         if ($teachers = get_users_by_capability(get_context_instance(CONTEXT_COURSE, $course->id), 'moodle/course:update',
-            'u.*,ra.hidden', 'r.sortorder ASC', 0, 1, '', '', false, true)) {
+            'u.*', 'u.id ASC', 0, 1, '', '', false, true)) {
             $teacher = array_shift($teachers);
         }
         if (!empty($teacher)) {