Synchronizing LDAP and Moodle

Synchronizing LDAP and Moodle

by Ivica Matotek -
Number of replies: 4
Picture of Testers
Hi!

I have set up Moodle (Moodle 1.9.2) and LDAP (OpenLdap) on the same server and I can authentication users, but I can not synchronize other user’s data from LDAP to Moodle.


ldap_upit
Does anybody know how can I transfer all the users from LDAP to Moodle, is there some synchronization possible?

Ivica
Average of ratings: -
In reply to Ivica Matotek

Re: Synchronizing LDAP and Moodle

by Robert Allerstorfer -
Ivica,

you first should upgrade your Moodle to 1.9.3. Version 1.9.2 has known security holes.

I am also using the "LDAP server" Moodle User Authentication with OpenLDAP (v2.3.43) running on the same server (Host URL= ldapi://). For that Moodle installation I am running the following crontab entries:

5 23 * * * php -d safe_mode="off" -d open_basedir="" /path_to/moodle/auth/ldap/auth_ldap_sync_users.php > /dev/null
*/30 * * * * php -d safe_mode="off" -d open_basedir="" /
path_to/moodle/admin/cron.php > /dev/null

The first entry is to synchronize Moodle's user data with those stored in the LDAP server.

In reply to Robert Allerstorfer

Re: Synchronizing LDAP and Moodle

by Ivica Matotek -
Picture of Testers
Hi!

I have run this script:
root@linux:/etc/ldap# php -d safe_mode="off" -d open_basedir="" /var/www/moodle/auth/ldap/auth_ldap_sync_users.php
Configuring temp table
Creating temp table mdl_extuser
Connecting to ldap...
Did not get any users from LDAP -- error? -- exiting

But, where I supply username and password for LDAP?

Ivica

In reply to Ivica Matotek

Re: Synchronizing LDAP and Moodle

by Robert Allerstorfer -
Go to Moodle's "Site Administration -> Users -> Authentication -> LDAP server" and provide the credentials within the section "Bind settings":

"Distinguished Name": The rootdn value set in slapd.conf
"Password": The rootpw value set in slapd.conf
In reply to Robert Allerstorfer

Re: Synchronizing LDAP and Moodle

by Ivica Matotek -
Picture of Testers
Hi!

I already did that and I can authenticate on Moodle by usage of LDAP password, but, in this cron script where I suppose to write LDAP username and password for script to connect. Does it know from some Moodle database where I have been written this information or what? And what is correct syntax for other LDAP fields to synchronize with Moodle?

Thank you.

Ivica