|
|
|
Environment:
|
1.9.5 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1
|
|
If in the definition rol the admin make that teacher can't unenrol self from course, the "Unenrol me from...." link is not displayed, but the teacher can unenrol self using Assign roles module, and pressing "Remove" button.
For avoid this should modify the script:
moodle/admin/roles/assign.php
line: 230
where the code says this:
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
continue;
}
by this:
if (($topleveladmin && ($removeuser == $USER->id)) ||
(($removeuser == $USER->id) && !has_capability('moodle/role:unassignself', $context, $removeuser, false))
) { // Prevent unassigning oneself from being admin continue; } }
Cheers
|
|
Description
|
If in the definition rol the admin make that teacher can't unenrol self from course, the "Unenrol me from...." link is not displayed, but the teacher can unenrol self using Assign roles module, and pressing "Remove" button.
For avoid this should modify the script:
moodle/admin/roles/assign.php
line: 230
where the code says this:
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
continue;
}
by this:
if (($topleveladmin && ($removeuser == $USER->id)) ||
(($removeuser == $USER->id) && !has_capability('moodle/role:unassignself', $context, $removeuser, false))
) { // Prevent unassigning oneself from being admin continue; } }
Cheers |
Show » |
| There are no comments yet on this issue.
|
|