From: moodler Date: Fri, 30 Jan 2004 05:59:33 +0000 (+0000) Subject: When adding a teacher, remove them as a student. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bb8c36313c61294125696fc78f668d7384ac25f1;p=moodle.git When adding a teacher, remove them as a student. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 2c4d295c74..7e3fc467e9 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -807,6 +807,8 @@ function add_teacher($userid, $courseid) { } else { $teacher->authority = 1; } + delete_records("user_students", "userid", $userid, "course", $courseid); // Unenrol as student + return insert_record("user_teachers", $teacher); } return false;