mirror of
https://github.com/moodle/moodle.git
synced 2025-06-03 06:35:57 +02:00
Only editing teachers are allowed to unenrol students
This commit is contained in:
parent
62b8075632
commit
f7f2ff6dba
@ -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) {
|
||||
|
@ -1305,7 +1305,7 @@ function print_user($user, $course) {
|
||||
$timemidnight = usergetmidnight(time());
|
||||
echo "<a href=\"$CFG->wwwroot/course/user.php?id=$course->id&user=$user->id\">$string->activity</a><br>";
|
||||
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 "<a href=\"$CFG->wwwroot/course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</a><br />";
|
||||
}
|
||||
if ($USER->id != $user->id) {
|
||||
|
@ -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 "<td nowrap><p><form action=\"../course/unenrol.php\" method=get>";
|
||||
echo "<input type=hidden name=id value=\"$course->id\">";
|
||||
echo "<input type=hidden name=user value=\"$user->id\">";
|
||||
|
Loading…
x
Reference in New Issue
Block a user