LDAP account/enrolment manager

LDAP account/enrolment manager

by Michael Goncharenko -
Number of replies: 5

Preved uchasnechgi,

We have completely set up moodle to use LDAP authentication and authorization (a.k.a LDAP enrolments) with course auto-creation.

Now I use Java LDAP Browser/Editor to manage users and courses. But it requires me to do many iterations and fill many fields when creating a user or a course. Is there any more "moodled" solution to make moodle/ldap management easier?

Opensource student information system, for example, which can be integrated with LDAP? And which uses the same way of user/course management that Moodle does?

Thanks,
Michael.

Average of ratings: -
In reply to Michael Goncharenko

Re: LDAP account/enrolment manager

by David Walton -
Michael,

Before I go off and tell you how to solve your problem, let me make sure I understand what you want to do.

Are you saying that you want to fill in some of the stock fields in your LDAP user and course objects so they can be mapped in meaningful way in Moodle (I seem to be feeling alliterative tonight...)? If that's the case, then there are command-line utilities for manipulating LDIF files that would allow you to do what you need. What we do is to dump the output of the ldapsearch command into a file, use a text editor to change the entries (you can change multiple entries at once if you've got an editor that handles regular expressions--we use TextWrangler on Mac OS X), and then update the directory using the ldapmodify command. These two commands are useful for processing bulk entries from the command line. Most Linux and UNIX variants will have them, and you can find install the proper client libraries on just about any operating system you like, I suspect--do a search for LDAP or OpenLDAP on sourceforge.net.

If this is what you're looking for, I can give you examples of the kinds of things we do for bulk manipulation of our LDAP directory.

David Walton
In reply to David Walton

Re: LDAP account/enrolment manager

by Michael Goncharenko -

Hello David,

thanks for your replysmile Sure, that's an interesting approach to export course information via ldapsearch and then modify it with ldapmodifysmile

But there's a problem: I use unicode for storing information in LDAP. So LDIF file contains the following:

displayName:: 0JLQstC10LTQtdC90LjQtSDQsiDQvtC/0LXRgNCw0YbQuNC+0L3QvdGD0Y4g0YHQuNGB0YLQtdC80YMgTGludXggKNC00LXQvNC+LdCy0LXRgNGB0LjRjyk=

Here I should do a base64-decode, convert from utf-8 to koi8-r (for normal editing), and then change it all back. That would take a long time.

So I would like to use a web-interface which could do all that for me and allow me to manage users/groups/enrolments via web.

I can give you examples of the kinds of things we do for bulk manipulation of our LDAP directory.

Do please, I'm interested smile

In reply to Michael Goncharenko

Re: LDAP account/enrolment manager

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Maybe phpLDAPAdmin?

Saludos. Iñaki.
In reply to Michael Goncharenko

Re: LDAP account/enrolment manager

by David Walton -
I second Iñaki's suggestion; phpLDAPAdmin is probably the way to go. You could do the Base-64 encoding and decoding in Perl, if you're into that kind of thing, but I would only bother with that if you're interested, or if phpLDAPAdmin doesn't do what you need.

We presently do bulk loads of our courses from LDIF files as part of our testing and use a combination of Perl and shell scripts to process them.  A good deal of it is trivial. 

- Remapping or modifying attributes: I'm experimenting with the best way to store attributes for our courses and how to map them in Moodle. I can switch them around, or modify each attribute using awk or sed, after I do a dump of all objects in our Enrollments containers (e.g., ldapsearch -x -H ldap://our.server.edu:389 -D "cn=our,ou=LDAP,ou=admin" -b "ou=Enrollments,ou=Instructors,ou=Moodle" -W "cn=*" | sed //s/Spring2006/Summer2006// > export.ldif or run an awk/Perl script to add the changetype: replace and attribute lines, and use ldapmodify to load the changes).
- We plan to do a periodic load of course registrations into our LDAP server for LDAP auto-enrollment.  In order to process merely the adds, I wrote a very quick and dirty script (quick and stinky is more like it) to dump our Enrollments container, parse the resulting LDIF file, and generate a new LDIF file with the adds and deletes.
- When we need to reset the courses containers, we write scripts to do the bulk deletes ( ldapsearch -x -H ldap://our.server.edu:389 -D "cn=our,ou=LDAP,ou=admin" -b "ou=Enrollments,ou=Instructors,ou=Moodle" -W "cn=*" dn | grep "dn: " > delete.ldif ; ldapdelete -H ldap://our.server.edu:389 -D "cn=our,ou=LDAP,ou=admin" -W -f delete.ldif).

As I say, these are all just examples, and none of this is rocket science.  smile

David Walton