<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=LDAP_enrolment</id>
	<title>LDAP enrolment - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=LDAP_enrolment"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=LDAP_enrolment&amp;action=history"/>
	<updated>2026-05-06T15:38:54Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=LDAP_enrolment&amp;diff=259&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=LDAP_enrolment&amp;diff=259&amp;oldid=prev"/>
		<updated>2024-10-14T16:47:16Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 16:47, 14 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=LDAP_enrolment&amp;diff=258&amp;oldid=prev</id>
		<title>1&gt;Tim@horizoneducationnetwork.org: clean up, typos fixed: e.g  → e.g.</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=LDAP_enrolment&amp;diff=258&amp;oldid=prev"/>
		<updated>2021-12-09T17:06:41Z</updated>

		<summary type="html">&lt;p&gt;clean up, typos fixed: e.g  → e.g.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Enrolment}}{{Update}}&lt;br /&gt;
Location: LDAP edit settings link in &amp;#039;&amp;#039;Site administration &amp;gt; Plugins &amp;gt; Enrolments &amp;gt; Manage enrol plugins&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to set up LDAP enrollment==&lt;br /&gt;
This describes how to set up Lightweight Directory Access Protocol (LDAP) enrollment in Moodle (first written by Lars Jensen). LDAP enrolment works best in Moodle when used in conjunction with [[LDAP authentication]], and we&amp;#039;re going to assume that you have already set Moodle up for LDAP authentication.&lt;br /&gt;
&lt;br /&gt;
=== Assumptions ===&lt;br /&gt;
&lt;br /&gt;
# You are running a recent version of Moodle. &lt;br /&gt;
# You are using LDAP authentication as your primary authentication method.&lt;br /&gt;
# Each user in has a uid attribute in the users LDAP record, that matches the ID number in the same users Moodle profile (this can easily be arranged with a mapping on the Moodle LDAP Authentication setup page - for Active Directory, use &amp;#039;distinguishedName&amp;#039;, without the quotes)&lt;br /&gt;
&lt;br /&gt;
=== The Course Setup ===&lt;br /&gt;
&lt;br /&gt;
Our setup involves the following course and user definitions:&lt;br /&gt;
&lt;br /&gt;
* Two courses, &amp;#039;&amp;#039;&amp;#039;Math101&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Eng201&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Two teachers, &amp;#039;&amp;#039;&amp;#039;TeacherA&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;TeacherB&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Three students, &amp;#039;&amp;#039;&amp;#039;StudentD&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;StudentE&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;StudentF&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* StudentD and StudentE are enrolled as students in Math101, and TeacherA is enrolled as teacher of Math101. StudentE and StudentF are enrolled as students in Eng201, and TeacherA and TeacherB are both enrolled as teachers of Eng201.&lt;br /&gt;
&lt;br /&gt;
=== The LDAP Container Setup ===&lt;br /&gt;
&lt;br /&gt;
# Define two LDAP containers ou=StudentEnrollment and ou=TeacherEnrollment&lt;br /&gt;
# For each course we define an LDAP group entry (e.g. a posixGroup entry) in the StudentEnrollment and TeacherEnrollment containers. Thus, we define a Math101 posixGroup under StudentEnrollment, and we define a Math101 posixGroup under TeacherEnrollment. We define the two Eng201 groups in a similar way. Be careful, &amp;#039;&amp;#039;&amp;#039;the name of the posixGroup has to match the Course ID number of the Moodle course.&amp;#039;&amp;#039;&amp;#039; Do not use the course short name, it will not work. (Changing the group name slightly in the Windows pre 2000 group name window will allow you to have two security groups with the same name in MS-AD)&lt;br /&gt;
# Enroll students and teachers as members of in the LDAP-groups we just defined. This is done by entering the users uid attribute (idnumber) in the memberUid attribute of the relevant group:&lt;br /&gt;
#* TeacherA is a member of the Math101 group under TeacherEnrollment.&lt;br /&gt;
#* StudentD and StudentE are a members of the Math101 group under StudentEnrollment.&lt;br /&gt;
#* TeacherA and TeacherB are members of the Eng201 group under TeacherEnrollment&lt;br /&gt;
#* StudentE and StudentF are a members of the Eng201 group under StudentEnrollment.&lt;br /&gt;
&lt;br /&gt;
=== The LDAP Enrollment Configuration in Moodle ===&lt;br /&gt;
&lt;br /&gt;
The LDAP enrollment settings in Moodle corresponding to the above setup are as follows:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot;  cellpadding=&amp;quot;5&amp;quot;  border=&amp;quot;1&amp;quot;&lt;br /&gt;
! LDAP Enrollment Variable:&lt;br /&gt;
! Value:&lt;br /&gt;
|- &lt;br /&gt;
| enrol_ldap_student_contexts:&lt;br /&gt;
| ou=StudentEnrollment,dc=ldapserver,dc=tmcc,dc=edu&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_student_memberattribute:&lt;br /&gt;
| memberUid  (use &amp;#039;member&amp;#039; -without the quotes- for Active Directory)&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_contexts:&lt;br /&gt;
| ou=TeacherEnrollment,dc=ldapserver,dc=tmcc,dc=edu&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_memberattribute:&lt;br /&gt;
| memberUid  (use &amp;#039;member&amp;#039; -without the quotes- for Active Directory)&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_objectclass:&lt;br /&gt;
| posixGroup (use &amp;#039;group&amp;#039; -without the quotes- for Active Directory)&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_idnumber:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_shortname:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_fullname:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_autocreate:&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally, since you are using LDAP authentication, you should also map the Moodle &amp;quot;ID number&amp;quot; of users to the &amp;quot;uid&amp;quot; in the ldap entry of the user. This is done on the Moodle LDAP Authentication page (not the LDAP Enrollment page).&lt;br /&gt;
&lt;br /&gt;
=== Automatic course creation ===&lt;br /&gt;
&lt;br /&gt;
Courses can be created automatically if there are LDAP enrolments to a course that doesn&amp;#039;t yet exist in Moodle. To enable this, set &amp;#039;&amp;#039;&amp;#039;enrol_ldap_autocreate&amp;#039;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;#039;Yes&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;enrol_ldap_category&amp;#039;&amp;#039;&amp;#039; field sets the category for the automatically created courses.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;enrol_ldap_template&amp;#039;&amp;#039;&amp;#039; field can contain the &amp;#039;&amp;#039;shortname&amp;#039;&amp;#039; of a course that is used as a template in the automatic course creation.&lt;br /&gt;
&lt;br /&gt;
Note that only the basic settings are copied from the template course such as start date, format etc. no content or block configuration will be copied over.&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
# You do not need to create the courses manually in Moodle. If they don&amp;#039;t exist, they will be created when the first enrolled user login.&lt;br /&gt;
# We are using the same string cn and uid in a users LDAP record. This is not necessary, I believe. However, if you use different values, you will need to define the ldap_user_attribute to uid in the LDAP authentication setup.&lt;br /&gt;
# The value of the group id number (gidNumber) defined for the groups in step 2 of the LDAP Container Setup above is not critical. It is not used in this setup.&lt;br /&gt;
# The attached .ldif file assumes that users are in the ou=People container in LDAP. You will need to configure your LDAP Authentication setup to reflect this (ldap_contexts variable).&lt;br /&gt;
# User passwords for this setup are defined in the attached .ldif file.&lt;br /&gt;
# If you use the attached .ldif file, you&amp;#039;ll need to edit the ldap server information (the &amp;quot;dn=&amp;quot; lines).&lt;br /&gt;
&lt;br /&gt;
==Other LDAP Layout==&lt;br /&gt;
&lt;br /&gt;
I do suggest to create a new LDAP object, say &amp;lt;TT&amp;gt;moodleCourse&amp;lt;/TT&amp;gt;, which contains all information,&amp;amp;amp; members of the course, including teachers, students a.s.o. For instance (OpenLDAP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
attributetype ( oidAttrBase:44 NAME ( &amp;#039;teacherUid&amp;#039; ) SUP memberUid&lt;br /&gt;
        DESC &amp;#039;which person is a teacher of this course&amp;#039;&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
objectclass ( oidObjRoot:14 NAME &amp;#039;moodleCourse&amp;#039; SUP top STRUCTURAL&lt;br /&gt;
        DESC &amp;#039;course available in Moodle&amp;#039;&lt;br /&gt;
        MUST ( cn  )&lt;br /&gt;
        MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
Note: Openldap 2.x will need something like:&lt;br /&gt;
&lt;br /&gt;
attributetype   ( 1.2.1.1.1.1.2.1 NAME &amp;#039;teacherUid&amp;#039;&lt;br /&gt;
                SUP memberUid&lt;br /&gt;
                DESC &amp;#039;which person is a teacher of this course&amp;#039;&lt;br /&gt;
                EQUALITY caseExactIA5Match&lt;br /&gt;
                SUBSTR caseExactIA5SubstringsMatch&lt;br /&gt;
                SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )&lt;br /&gt;
&lt;br /&gt;
objectclass     ( 1.2.1.1.1.1.1.1&lt;br /&gt;
                NAME &amp;#039;moodleCourse&amp;#039;&lt;br /&gt;
                SUP top STRUCTURAL&lt;br /&gt;
                DESC &amp;#039;course available in Moodle&amp;#039;&lt;br /&gt;
                MUST ( cn  )&lt;br /&gt;
                MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )&lt;br /&gt;
                )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The configuration is like this, in &amp;lt;B&amp;gt;bold&amp;lt;/B&amp;gt; you see required changes, in &amp;lt;I&amp;gt;italic&amp;lt;/I&amp;gt; you see&lt;br /&gt;
useful changes.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot;  cellpadding=&amp;quot;5&amp;quot;  border=&amp;quot;1&amp;quot;&lt;br /&gt;
! LDAP Enrollment Variable:&lt;br /&gt;
! Value:&lt;br /&gt;
|- &lt;br /&gt;
| enrol_ldap_student_contexts:&lt;br /&gt;
| &amp;lt;I&amp;gt;ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu&amp;lt;/I&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_student_memberattribute:&lt;br /&gt;
| memberUid&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_contexts:&lt;br /&gt;
| &amp;lt;I&amp;gt;ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu&amp;lt;/I&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_memberattribute:&lt;br /&gt;
| &amp;lt;B&amp;gt;teacherUid&amp;lt;/B&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_objectclass:&lt;br /&gt;
| &amp;lt;B&amp;gt;moodleGroup&amp;lt;/B&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_idnumber:&lt;br /&gt;
| &amp;lt;I&amp;gt;cn&amp;lt;/I&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_shortname:&lt;br /&gt;
| givenname&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_fullname:&lt;br /&gt;
| sn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_summary:&lt;br /&gt;
| description&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_autocreate:&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;STRONG&amp;gt;Note:&amp;lt;/STRONG&amp;gt; The &amp;lt;TT&amp;gt;enrol_ldap_course_idnumber&amp;lt;/TT&amp;gt; (&amp;lt;TT&amp;gt;cn&amp;lt;/TT&amp;gt; in my setup) is used to identify the course by the LDAP enrolment script and the database uses an &amp;lt;TT&amp;gt;INTEGER&amp;lt;/TT&amp;gt; numeric here, in Moodle v1.8 anyway. When you&lt;br /&gt;
call &amp;lt;CODE&amp;gt;cd enrol/ldap/ &amp;amp;&amp;amp; php -f enrol_ldap_sync.php&amp;lt;/CODE&amp;gt; any course with the same idnumber is updated, hence,&lt;br /&gt;
it is quite important for the LDAP synchronisation and needs to be unique.&lt;br /&gt;
&lt;br /&gt;
Sample of an moodleCourse LDAP object:&lt;br /&gt;
&amp;lt;pre&amp;gt;dn: cn=851,ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu&lt;br /&gt;
objectClass: moodleCourse&lt;br /&gt;
cn: 851&lt;br /&gt;
givenName: LV851&lt;br /&gt;
sn: 2007S/Introduction to Moodle&lt;br /&gt;
description: Jahr: 2007 Sommer, &amp;amp;lt;A TARGET=_blank HREF=&amp;quot;https://other_server/display/851&amp;quot;&amp;gt;Announcement&amp;amp;lt;/A&amp;gt;&lt;br /&gt;
teacherUid: userA&lt;br /&gt;
memberUid: user1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the same fashion one can add all the other role mappings.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://download.moodle.org/download.php/docs/en/how-to_guides/ldap_auth_and_enrolment_set-up.pdf LDAP auth and enrolment set-up guide] (PDF 227KB)&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=31761 LDAP Enrollment HOWTO] with Lars Jensen&amp;#039;s 2005 post&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=39549 LDAP Auto enrollment] &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=41829 LDAP nightmare Part II] &lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=56198 Moodle + AD + LDAP = Confusion - Help Required and Provided]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol Wikipedia on LDAP:] a great deal of information beyond the context of Moodle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[de:LDAP-Einschreibung]]&lt;br /&gt;
[[es:Inscripción por LDAP]]&lt;br /&gt;
[[fr:Inscription par LDAP]]&lt;br /&gt;
[[ja:LDAPユーザ登録]]&lt;/div&gt;</summary>
		<author><name>1&gt;Tim@horizoneducationnetwork.org</name></author>
	</entry>
</feed>