Moodle 1.9x中的Enroll插件可以使用setup_enrolments(&$user)
方法来设置用户注册。当用户登录时,lib调用此方法。
Moodle 2.x是否采用了类似的方法?
我找不到对setup_enrolments()
方法的任何调用。它必须有另一个名字吗?
答案 0 :(得分:0)
是的,我相信enrol_plugin :: sync_user_enrolments()可以做到。来自lib/enrollib.php:
/**
* Forces synchronisation of user enrolments.
*
* This is important especially for external enrol plugins,
* this function is called for all enabled enrol plugins
* right after every user login.
*
* @param object $user user record
* @return void
*/
public function sync_user_enrolments($user) {
// override if necessary
}