Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]
Database enrolment plugin. This plugin synchronises enrolment and roles with external database table.
Copyright: | 2010 Petr Skoda {@link http://skodak.org} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1076 lines (46 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
enrol_database_plugin:: (16 methods):
can_delete_instance()
can_hide_show_instance()
allow_unenrol_user()
sync_user_enrolments()
sync_enrolments()
sync_courses()
db_get_sql()
db_init()
db_addslashes()
db_encode()
db_decode()
restore_sync_course()
restore_instance()
restore_user_enrolment()
restore_role_assignment()
test_settings()
Class: enrol_database_plugin - X-Ref
Database enrolment plugin implementation.can_delete_instance($instance) X-Ref |
Is it possible to delete enrol instance via standard UI? param: stdClass $instance return: bool |
can_hide_show_instance($instance) X-Ref |
Is it possible to hide/show enrol instance via standard UI? param: stdClass $instance return: bool |
allow_unenrol_user(stdClass $instance, stdClass $ue) X-Ref |
Does this plugin allow manual unenrolment of a specific user? Yes, but only if user suspended... param: stdClass $instance course enrol instance param: stdClass $ue record from user_enrolments table return: bool - true means user with 'enrol/xxx:unenrol' may unenrol this user, false means nobody may touch this user enrolment |
sync_user_enrolments($user) X-Ref |
Forces synchronisation of user enrolments with external database, does not create new courses. param: stdClass $user user record return: void |
sync_enrolments(progress_trace $trace, $onecourse = null) X-Ref |
Forces synchronisation of all enrolments with external database. param: progress_trace $trace param: null|int $onecourse limit sync to one course only (used primarily in restore) return: int 0 means success, 1 db connect failure, 2 db read failure |
sync_courses(progress_trace $trace) X-Ref |
Performs a full sync with external database. First it creates new courses if necessary, then enrols and unenrols users. param: progress_trace $trace return: int 0 means success, 1 db connect failure, 4 db read failure |
db_get_sql($table, array $conditions, array $fields, $distinct = false, $sort = "") X-Ref |
No description |
db_init() X-Ref |
Tries to make connection to the external database. return: null|ADONewConnection |
db_addslashes($text) X-Ref |
No description |
db_encode($text) X-Ref |
No description |
db_decode($text) X-Ref |
No description |
restore_sync_course($course) X-Ref |
Automatic enrol sync executed during restore. param: stdClass $course course record |
restore_instance(restore_enrolments_structure_step $step, stdClass $data, $course, $oldid) X-Ref |
Restore instance and map settings. param: restore_enrolments_structure_step $step param: stdClass $data param: stdClass $course param: int $oldid |
restore_user_enrolment(restore_enrolments_structure_step $step, $data, $instance, $userid, $oldinstancestatus) X-Ref |
Restore user enrolment. param: restore_enrolments_structure_step $step param: stdClass $data param: stdClass $instance param: int $oldinstancestatus param: int $userid |
restore_role_assignment($instance, $roleid, $userid, $contextid) X-Ref |
Restore role assignment. param: stdClass $instance param: int $roleid param: int $userid param: int $contextid |
test_settings() X-Ref |
Test plugin settings, print info to output. |