]> git.mjollnir.org Git - moodle.git/commitdiff
Only editing teachers are allowed to unenrol students
authorgustav_delius <gustav_delius>
Sun, 30 May 2004 20:54:58 +0000 (20:54 +0000)
committergustav_delius <gustav_delius>
Sun, 30 May 2004 20:54:58 +0000 (20:54 +0000)
course/unenrol.php
lib/weblib.php
user/view.php

index 21d08bec2be24fd5a8a0ac7b23f007928dd0c21b..d3927dcb8efa419b8f40ac371f15ca778b695290 100644 (file)
@@ -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) {
index c3bcb528c58c06b2c76c07e986faee3375b1857b..9ba848eb77a92c5e37a13aeebc693e53f75f6c45 100644 (file)
@@ -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) {
index c2a6c015fef967fdf1ed278e26109773148ed44d..1955bfc1a3cc006f5bf04298002fa88df1e11cad 100644 (file)
     }
     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\">";