Friday, 15 February 2013

moodle - how to unenroll user programmatically -



moodle - how to unenroll user programmatically -

i want unenrol user course of study in moodle ,i want know there in built function like

unenrol_user($userid,$courseid)

try this

$instances = $db->get_record('enrol', array('courseid' => $courseid)); foreach ($instances $instance) { $plugin = enrol_get_plugin($instance->enrol); $plugin->unenrol_user($instance, $userid); }

moodle

No comments:

Post a Comment