function course_signup_signup_enroll in Course 6
Same name and namespace in other branches
- 7.2 modules/course_signup/course_signup.module \course_signup_signup_enroll()
- 7 modules/course_signup/course_signup.module \course_signup_signup_enroll()
Helper signup course enroll criteria function for insert & update.
See also
2 calls to course_signup_signup_enroll()
- course_signup_signup_insert in modules/
course_signup/ course_signup.module - Implements hook_signup_insert().
- course_signup_signup_update in modules/
course_signup/ course_signup.module - Implements hook_signup_update().
File
- modules/
course_signup/ course_signup.module, line 115
Code
function course_signup_signup_enroll($signup) {
if ($signup->uid && $signup->nid && $signup->count_towards_limit && empty($signup->anon_mail)) {
$node = node_load($signup->nid);
if (course_node_is_course($node)) {
$user = user_load($signup->uid);
course_enrol($node, $user, 'course_signup');
}
}
}