Torres
Torres

Reputation: 129

How to add a course to an existing user in moodle remotely?

I'm using LDAP to create users in Moodle. However, after creating an user (adding to LDAP and running the sync script) i want to enroll that user to a course. How one does that? :)

Upvotes: 12

Views: 1778

Answers (2)

Autodidact
Autodidact

Reputation: 768

You have four options that I know of:

  1. WebServices using the enrol_manual_enrol_users() function
  2. LDAP enrollment requires a lot of set-up work in active directory
  3. External database enrollment
  4. Flat file enrollment requires ftp access to your server

Upvotes: 0

Adam Franco
Adam Franco

Reputation: 86078

If by "remotely" you mean via a remote script, the one option is to use the SOAP webservices module:

This module works with Moodle 1.9 and 2.0 and provides access to methods for user creation, course creation, and enrollment along with much else.

I'm currently using this module in a Moodle 1.9 installation as my sole enrollment process (without creating courses via LDAP on login), but there is no reason you couldn't write a script that looks through your course groups and adds any missing users to the matching Moodle courses them by calling the SOAP methods.

Upvotes: 5

Related Questions