External database enrolment: diferència entre les revisions
(Added roles and synchronization information) |
(Detail field mapping) |
||
Línia 34: | Línia 34: | ||
You may synchronize all enrolments by executing the enrol_database_sync.php script. This assumes that you have already synchronized all users from your authorization plugin. | You may synchronize all enrolments by executing the enrol_database_sync.php script. This assumes that you have already synchronized all users from your authorization plugin. | ||
== Field Mapping Example: == | |||
Choose your fields from the Moodle database: | |||
*enrol_localcoursefield: A course identifier from mdl_course, e.g. "idnumber" | |||
*enrol_localuserfield: A user identifier from mdl_user, e.g. "idnumber" | |||
*enrol_localrolefield: (optional) A role identifier from mdl_role, e.g. "shortname" | |||
Create a view in your external database which matches the chosen field values from Moodle: | |||
*enrol_remotecoursefield: A matching course identifier from your external database table, e.g. "course_number" | |||
*enrol_remoteuserfield: A matching user identifier from your external database table, e.g. "userid" | |||
*enrol_remoterolefield: (optional) A matching role identifier from your external database table, e.g. "role_name" | |||
==See also== | ==See also== |
Revisió del 21:53, 20 des 2006
You may use a external database (of nearly any kind) to control your enrolments. It is assumed your external database contains a field containing a course ID, a field containing a user ID, and optionally a field containing a role. These are compared against fields that you choose in the local course, user tables, and role tables.
Supported data sources
- access
- ado
- mssql
- borland_ibase
- csv
- db2
- fbsql
- firebird
- ibase
- informix72
- informix
- mysql
- mysqlt
- oci805
- oci8
- oci8po
- odbc
- odbc_mssql
- odbc_oracle
- oracle
- postgres64
- postgres7
- postgres
- proxy
- sqlanywhere
- sybase
- vfp
External database enrolment happens at the moment when a user logs into Moodle. An easy way of checking how it's working is to try logging in as a student. External database enrolment also manages unenrolment.
You may synchronize all enrolments by executing the enrol_database_sync.php script. This assumes that you have already synchronized all users from your authorization plugin.
Field Mapping Example:
Choose your fields from the Moodle database:
- enrol_localcoursefield: A course identifier from mdl_course, e.g. "idnumber"
- enrol_localuserfield: A user identifier from mdl_user, e.g. "idnumber"
- enrol_localrolefield: (optional) A role identifier from mdl_role, e.g. "shortname"
Create a view in your external database which matches the chosen field values from Moodle:
- enrol_remotecoursefield: A matching course identifier from your external database table, e.g. "course_number"
- enrol_remoteuserfield: A matching user identifier from your external database table, e.g. "userid"
- enrol_remoterolefield: (optional) A matching role identifier from your external database table, e.g. "role_name"
See also
- Using Moodle MySQL enrolment plugin doesn't seem to work forum discussion