在Moodle 2.x中设置注册

时间:2012-11-27 16:51:53

标签: moodle

Moodle 1.9x中的Enroll插件可以使用setup_enrolments(&$user)方法来设置用户注册。当用户登录时,lib调用此方法。

Moodle 2.x是否采用了类似的方法?

我找不到对setup_enrolments()方法的任何调用。它必须有另一个名字吗?

1 个答案:

答案 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
}