I discovered yesterday the existence of the custom scripts. I solved the problem hacking the unrolment process putting ahead my code and then including the original unenrol.php. This way I will call my web services to keep an external track and then I will proceed including the normal unenrol.php.
I suppose this hack will be easily independent from following moodle upgrades...
Here the code of my customscripts/course/unenrol.php:
$confirm_tmp = optional_param('confirm', 0, PARAM_BOOL);
// Inside the original unenrol.php there is all the sequence of controls
// BEFORE arriving to the form with the YES/NO buttons,
// so the confirmation message reception should
// mean we already passed the control tests
if ($confirm_tmp and confirm_sesskey())
// DO WHAT YOU NEED EXTRA
If needed, the include can be also tied (with just an "else") to the confirmation reception, so the whole unenrolment process can be overwritten.
Unenrollment in enrol plugin
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.