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? :)
Asked
Active
Viewed 1,752 times
12
-
Have you looked into the web services API? – Klaus S. Jul 22 '11 at 17:30
-
3I've created a proposal for a Stack Exchange website for Moodle users and developers. This question would be a perfect fit for it, rather than for Stack Overflow. http://area51.stackexchange.com/proposals/33861/virtual-learning-environments – Roberto Aloi Aug 01 '11 at 14:48
-
There is this [document](http://download.moodle.org/docs/en/how-to_guides/ldap_auth_and_enrolment_set-up.pdf). – Terry Gardner Aug 08 '11 at 10:47
2 Answers
5
If by "remotely" you mean via a remote script, the one option is to use the SOAP webservices module:
- https://github.com/patrickpollet/moodlews
- http://docs.moodle.org/20/en/Web_Services:OK_Tech_Web_Services
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.

Adam Franco
- 81,148
- 4
- 36
- 39
0
You have four options that I know of:
- WebServices using the enrol_manual_enrol_users() function
- LDAP enrollment requires a lot of set-up work in active directory
- External database enrollment
- Flat file enrollment requires ftp access to your server

Autodidact
- 768
- 1
- 9
- 11