From 7cd9fcfe639aa9b5d6c4a093ae5c97ab67242e23 Mon Sep 17 00:00:00 2001
From: skodak <skodak>
Date: Sun, 25 May 2008 11:07:57 +0000
Subject: [PATCH] MDL-14978 removed obsoleted get_course_teachers()

---
 lib/deprecatedlib.php | 50 -------------------------------------------
 1 file changed, 50 deletions(-)

diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php
index ea3d28887d..078e7cdd0d 100644
--- a/lib/deprecatedlib.php
+++ b/lib/deprecatedlib.php
@@ -203,56 +203,6 @@ function get_recent_enrolments($courseid, $timestart) {
                               ORDER BY l.time ASC");
 }
 
-/**
- * Returns list of all teachers in this course
- *
- * If $courseid matches the site id then this function
- * returns a list of all teachers for the site.
- *
- * @uses $CFG
- * @param int $courseid The course in question.
- * @param string $sort ?
- * @param string $exceptions ?
- * @return object
- * @todo Finish documenting this function
- */
-function get_course_teachers($courseid, $sort='t.authority ASC', array $exceptions=null) {
-
-    global $CFG;
-
-    $sort = 'ul.timeaccess DESC';
-
-    $context = get_context_instance(CONTEXT_COURSE, $courseid);
-
-    /// For the site course, if the $CFG->defaultuserroleid is set to the legacy teacher role, then all
-    /// users are teachers. This function should be replaced where it is used with something more
-    /// meaningful.
-    if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {
-        if ($roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, $context)) {
-            $hascap = false;
-            foreach ($roles as $role) {
-                if ($role->id == $CFG->defaultuserroleid) {
-                    $hascap = true;
-                    break;
-                }
-            }
-            if ($hascap) {
-                if (empty($fields)) {
-                    $fields = '*';
-                }
-                return get_users(true, '', true, $exceptions, 'lastname ASC', '', '', '', '', $fields);
-            }
-        }
-    }
-
-    $users = get_users_by_capability($context, 'moodle/course:update',
-                                     'u.*, ul.timeaccess as lastaccess',
-                                     $sort, '','','',$exceptions, false);
-    return sort_by_roleassignment_authority($users, $context);
-
-    /// some fields will be missing, like authority, editall
-}
-
 /**
  * Returns all the users of a course: students and teachers
  *
-- 
2.39.5