Permalink
Browse files

Forbid restricted users from changing enrolments

  • Loading branch information...
1 parent 903c6f9 commit 744950fa72d26b71276b00db8c7e3cb81cd4f5f1 moodler committed Jul 21, 2004
Showing with 3 additions and 0 deletions.
  1. +3 −0 course/student.php
View
3 course/student.php
@@ -59,6 +59,7 @@
/// Add a student if one is specified
if (!empty($add)) {
+ check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
if (! enrol_student($add, $course->id)) {
error("Could not add that student to this course!");
}
@@ -67,6 +68,7 @@
/// Remove a student if one is specified.
if (!empty($remove)) {
+ check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
if (! unenrol_student($remove, $course->id)) {
error("Could not remove that student from this course!");
}
@@ -75,6 +77,7 @@
/// Remove all students from specified course
if (!empty($removeall)) {
+ check_for_restricted_user($USER->username, "$CFG->wwwroot/course/student.php?id=$course->id");
$students = get_course_students($course->id, "u.lastname ASC, u.firstname ASC");
foreach ($students as $student) {
if (! unenrol_student($student->id, $course->id)) {

0 comments on commit 744950f

Please sign in to comment.