From f7f2ff6dba86fa4290d3b7f4ff0783a3ce28bb91 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 30 May 2004 20:54:58 +0000 Subject: [PATCH] Only editing teachers are allowed to unenrol students --- course/unenrol.php | 4 ++-- lib/weblib.php | 2 +- user/view.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/course/unenrol.php b/course/unenrol.php index 21d08bec2b..d3927dcb8e 100644 --- a/course/unenrol.php +++ b/course/unenrol.php @@ -20,8 +20,8 @@ require_login($course->id); - if ($user->id != $USER->id and !isteacher($course->id)) { - error("You must be a teacher to do this"); + if ($user->id != $USER->id and !isteacheredit($course->id)) { + error("You must be a teacher with editing rights to do this"); } if ($user->id == $USER->id and !$CFG->allowunenroll) { diff --git a/lib/weblib.php b/lib/weblib.php index c3bcb528c5..9ba848eb77 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1305,7 +1305,7 @@ function print_user($user, $course) { $timemidnight = usergetmidnight(time()); echo "wwwroot/course/user.php?id=$course->id&user=$user->id\">$string->activity
"; if (!iscreator($user->id)) { // Includes admins - if (isstudent($course->id, $user->id)) { // Includes admins + if (isteacheredit($course->id) and isstudent($course->id, $user->id)) { // Includes admins echo "wwwroot/course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol
"; } if ($USER->id != $user->id) { diff --git a/user/view.php b/user/view.php index c2a6c015fe..1955bfc1a3 100644 --- a/user/view.php +++ b/user/view.php @@ -213,7 +213,7 @@ } if ($course->category and ((isstudent($course->id) and ($user->id == $USER->id) and !isguest() and $CFG->allowunenroll) or - (isteacher($course->id) and isstudent($course->id, $user->id))) ) { + (isteacheredit($course->id) and isstudent($course->id, $user->id))) ) { echo "

"; echo "id\">"; echo "id\">"; -- 2.39.5