id); if (isset($confirm)) { if (! unenrol_student_in_course($USER->id, $course->id)) { error("An error occurred while trying to unenrol you."); } add_to_log($course->id, "course", "unenrol", "view.php?id=$course->id", "$USER->id"); unset($USER->student["$id"]); redirect("$CFG->wwwroot"); } print_header("Unenrol from $course->shortname", "$course->shortname", "wwwroot/course/view.php?id=$course->id\">$course->shortname -> Unenrol"); notice_yesno ("Are you sure you want to remove yourself from this course?", "unenrol.php?id=$id&confirm=yes", "$HTTP_REFERER"); print_footer(); ?>