You are here

function course_signup_signup_cancel in Course 7

Same name and namespace in other branches
  1. 6 modules/course_signup/course_signup.module \course_signup_signup_cancel()
  2. 7.2 modules/course_signup/course_signup.module \course_signup_signup_cancel()

Implements hook_signup_cancel().

Un-enroll user from course on signup cancellation.

File

modules/course_signup/course_signup.module, line 141

Code

function course_signup_signup_cancel($signup, $node) {

  // TODO Convert "user_load" to "user_load_multiple" if "$signup->uid" is other than a uid.
  // To return a single user object, wrap "user_load_multiple" with "array_shift" or equivalent.
  // Example: array_shift(user_load_multiple(array(), $signup->uid))
  $user = user_load($signup->uid);
  course_unenroll($node, $user);
}