diff --git a/course/teacher.php b/course/teacher.php
index 6e5656481f0..7fe180fe8ae 100644
--- a/course/teacher.php
+++ b/course/teacher.php
@@ -13,7 +13,7 @@
require_login();
if (!iscreator()) {
- error("You must be an administrator or teacher to use this page.");
+ error("You must be an administrator or course creator to use this page.");
}
$strassignteachers = get_string("assignteachers");
@@ -40,7 +40,7 @@
print_simple_box_start("CENTER");
foreach ($courses as $course) {
- if ($isadmin OR ismainteacher($course->id, $USER->id)){
+ if ($isadmin OR isteacher($course->id, $USER->id)){
echo "id\">$course->fullname
\n";
$coursesfound = TRUE;
}
@@ -76,7 +76,7 @@
/// Add a teacher if one is specified
if (!empty($add)) {
- if (!ismainteacher($course->id, $USER->id)){
+ if (!isteacher($course->id, $USER->id)){
error("You must be an administrator or teacher to modify this course.");
}
@@ -110,7 +110,7 @@
if (!empty($remove)) {
- if (!ismainteacher($course->id, $USER->id)){
+ if (!isteacher($course->id, $USER->id)){
error("You must be an administrator or teacher to modify this course.");
}
if (! $user = get_record("user", "id", $remove)) {
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 8c6d33158f7..befe23378f8 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -418,24 +418,6 @@ function iscreator ($userid=0) {
return record_exists("user_coursecreators", "userid", $userid);
}
-function ismainteacher ($courseid, $userid=0){
-/// Is user the main teacher of course
- global $USER;
-
- if (isadmin($userid)) { // admins can do anything the teacher can
- return true;
- }
-
- if (empty($userid)) {
- if (empty($USER->id)) {
- return false;
- }
- $userid = $USER->id;
- }
-
- return record_exists("user_teachers", "userid", $userid, "course", $courseid, "authority", "1");
-}
-
function isstudent($courseid, $userid=0) {
/// Is the user a student in this course?
global $USER;