You are here

function course_remove_enrollment_action in Course 7

Same name and namespace in other branches
  1. 6 course.module \course_remove_enrollment_action()
  2. 7.2 course.module \course_remove_enrollment_action()

Action to unenroll a user.

File

./course.module, line 1906
course.module Core functionality for Courses.

Code

function course_remove_enrollment_action(&$enrollment, $context) {
  $node = node_load($enrollment->nid);
  $user = user_load($enrollment->uid);
  course_unenroll($node, $user);
}