Hinweis: Sie sind auf den Seiten der Moodle 3.1 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: LDAP-Einschreibung.

LDAP-Einschreibung: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „{{Einschreibung}} {{Zum Übersetzen}} en:LDAP enrolment“)
 
Keine Bearbeitungszusammenfassung
Zeile 2: Zeile 2:


{{Zum Übersetzen}}
{{Zum Übersetzen}}
Die [[LDAP-Einschreibung]] wird auf der Seite ''[[Einstellungen-Block|Einstellungen]] > Website-Administration > Plugins > Einschreibung > Übersicht'' aktiviert (siehe [[Einschreibungs-Plugins verwalten]]) und auf der Seite ''[[Einstellungen-Block|Einstellungen]] > Website-Administration > Plugins > Einschreibung > LDAP-Einschreibung'' konfiguriert.
Dieser Artikel beschreibt, wie die LDAP-Einschreibung in Moodle konfiguriert wird. Die LDAP-Einschreibung funktioniert am besten, wenn auch für die Authentifizierung der Nutzer/innen ein [[LDAP-Server]] verwendet wird.
==Voraussetzungen==
# Sie verwenden einen [[LDAP-Server]]als erste Authentifizierungsmethode.
# Alle Nutzer/innen haben ein '''uid''' Attribut im ihrem LDAP-Nutzer-Datensatz, das mit der Nutzer-ID in ihrem Moodle-Nutzerprofil übereinstimmt.
==Beispiel==
Wir betrachten das folgende einfache Beispiel:
* Zwei Kurse '''Math101''' und '''Eng201'''.
* Zwei Trainer/innen '''TrainerA''' und '''TrainerB'''.
* DreiTeilnehmer/innen '''TeilnehmerD''', '''TeilnehmerE''' und '''TeilnehmerF'''.
* '''TeilnehmerD''' und '''TeilnehmerE''' sind Teilnehmer/innen im Kurs '''Math101''' und '''TrainerA''' ist Trainer/in im Kurs '''Math101'''. '''TeilnehmerE''' und '''TeilnehmerF''' sind Teilnehmer/innen im Kurs '''Eng201''', und '''TrainerA''' und '''TrainerB''' sind beide Trainer/in im Kurs '''Eng201'''.
==LDAP-Server-Konfiguration==
# Definieren Sie zwei LDAP Container <code>ou=TeilnehmerEinschreibung</code> und <code>ou=TrainerEinschreibung</code>.
# Für jeden Kurs definieren Sie einen LDAP-Gruppeneintrag (z.B. einen <code>posixGroup</code> Eintrag) in den Containern <code>TeilnehmerEinschreibung</code> und <code>TrainerEinschreibung</code>. D.h. Sie definieren eine <code>Math101 posixGroup</code> unter <code>TeilnehmerEinschreibung</code> und eine <code>Math101 posixGroup</code> unter <code>TrainerEinschreibung</code>. Analog definieren Sie zwei <code>Eng201</code> Gruppen. '''Achtung''': Der Name der <code>posixGroup</code> muss mit der Kurs-ID des entsprechenden Moodle-Kurses übereinstimmen. Sie dürfen nicht die Kurzbezeichnung des Kurses verwenden - das würde nicht funktionieren!
# Tragen Sie die entsprechenden Teilnehmer/innen und Trainer/innen als Mitglieder (<code>member</code>) in den soeben definierten LDAP-Gruppen ein: Tragen Sie das <code>uid</code> Attribut der Nutzer/innen (idnumber) in das <code>memberUid</code> Attribut der entsprechenden Gruppe ein:
#* <code>TrainerA</code> ist Mitglied in der <code>Math101</code> Gruppe unter <code>TrainerEinschreibung</code>.
#* <code>TeilnehmerD</code> und <code>TeilnehmerE</code> sind Mitglieder der <code>Math101</code> Gruppe unter <code>TeilnehmerEinschreibung</code>.
#* <code>TrainerA</code> und <code>TrainerB</code>  sind Mitglieder der <code>Eng201</code> Gruppe unter <code>TrainerEinschreibung</code>.
#* <code>TeilnehmerE</code> und <code>TeilnehmerF</code> sind Mitglieder der <code>Eng201</code> Gruppe unter <code>TeilnehmerEinschreibung</code>.
=== The LDAP Enrollment Configuration in Moodle ===
The LDAP enrollment settings in Moodle corresponding to the above setup are as follows:
{| cellspacing="0"  cellpadding="5"  border="1"
! LDAP Enrollment Variable:
! Value:
|-
| enrol_ldap_student_contexts:
| ou=StudentEnrollment,dc=ldapserver,dc=tmcc,dc=edu
|-
| enrol_ldap_student_memberattribute:
| memberUid  (use 'member' -without the quotes- for Active Directory)
|-
| enrol_ldap_teacher_contexts:
| ou=TeacherEnrollment,dc=ldapserver,dc=tmcc,dc=edu
|-
| enrol_ldap_teacher_memberattribute:
| memberUid  (use 'member' -without the quotes- for Active Directory)
|-
| enrol_ldap_objectclass:
| posixGroup (use 'group' -without the quotes- for Active Directory)
|-
| enrol_ldap_course_idnumber:
| cn
|-
| enrol_ldap_course_shortname:
| cn
|-
| enrol_ldap_course_fullname:
| cn
|-
| enrol_ldap_autocreate:
| Yes
|-
|}
Additionally, since you are using LDAP authentication, you should also map the Moodle "ID number" of users to the "uid" in the ldap entry of the user. This is done on the Moodle LDAP Authentication page (not the LDAP Enrollment page).
=== Automatic course creation ===
Courses can be created automatically if there are LDAP enrolments to a course that doesn't yet exist in Moodle. To enable this, set '''enrol_ldap_autocreate''' to '''Yes'''.
'''enrol_ldap_category''' field sets the category for the automatically created courses.
'''enrol_ldap_template''' field can contain the ''shortname'' of a course that is used as a template in the automatic course creation.
=== Notes: ===
# You do not need to create the courses manually in Moodle. If they don't exist, they will be created when the first enrolled user login.
# 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.
# 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.
# 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).
# User passwords for this setup are defined in the attached .ldif file.
# If you use the attached .ldif file, you'll need to edit the ldap server information (the "dn=" lines).
==Other LDAP Layout==
I do suggest to create a new LDAP object, say <TT>moodleCourse</TT>, which contains all information,&amp; members of the course, including teachers, students a.s.o. For instance (OpenLDAP):
<pre>
attributetype ( oidAttrBase:44 NAME ( 'teacherUid' ) SUP memberUid
        DESC 'which person is a teacher of this course'
    )
objectclass ( oidObjRoot:14 NAME 'moodleCourse' SUP top STRUCTURAL
        DESC 'course available in Moodle'
        MUST ( cn  )
        MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )
        )
Note: Openldap 2.x will need something like:
attributetype  ( 1.2.1.1.1.1.2.1 NAME 'teacherUid'
                SUP memberUid
                DESC 'which person is a teacher of this course'
                EQUALITY caseExactIA5Match
                SUBSTR caseExactIA5SubstringsMatch
                SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
objectclass    ( 1.2.1.1.1.1.1.1
                NAME 'moodleCourse'
                SUP top STRUCTURAL
                DESC 'course available in Moodle'
                MUST ( cn  )
                MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )
                )
</pre>
The configuration is like this, in <B>bold</B> you see required changes, in <I>italic</I> you see
useful changes.
{| cellspacing="0"  cellpadding="5"  border="1"
! LDAP Enrollment Variable:
! Value:
|-
| enrol_ldap_student_contexts:
| <I>ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu</I>
|-
| enrol_ldap_student_memberattribute:
| memberUid
|-
| enrol_ldap_teacher_contexts:
| <I>ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu</I>
|-
| enrol_ldap_teacher_memberattribute:
| <B>teacherUid</B>
|-
| enrol_ldap_objectclass:
| <B>moodleGroup</B>
|-
| enrol_ldap_course_idnumber:
| <I>cn</I>
|-
| enrol_ldap_course_shortname:
| givenname
|-
| enrol_ldap_course_fullname:
| sn
|-
| enrol_ldap_course_summary:
| description
|-
| enrol_ldap_autocreate:
| Yes
|-
|}
<STRONG>Note:</STRONG> The <TT>enrol_ldap_course_idnumber</TT> (<TT>cn</TT> in my setup) is used to identify the course by the LDAP enrolment script and the database uses an <TT>INTEGER</TT> numeric here, in Moodle v1.8 anyway. When you
call <CODE>cd enrol/ldap/ && php -f enrol_ldap_sync.php</CODE> any course with the same idnumber is updated, hence,
it is quite important for the LDAP synchronisation and needs to be unique.
Sample of an moodleCourse LDAP object:
<pre>dn: cn=851,ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu
objectClass: moodleCourse
cn: 851
givenName: LV851
sn: 2007S/Introduction to Moodle
description: Jahr: 2007 Sommer, &lt;A TARGET=_blank HREF="https://other_server/display/851">Announcement&lt;/A>
teacherUid: userA
memberUid: user1</pre>
In the same fashion one can add all the other role mappings.
==Siehe auch==
* [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) - Anleitung zur Konfiguration der Authentifizierung und Einschreibung über einen LDAP-Server
* [http://de.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol Wikipedia-Artikel zu LDAP]
Diskussionsbeiträge im Kurs ''Using Moodle'' auf moodle.org
*[http://moodle.org/mod/forum/discuss.php?d=31761 LDAP Enrollment HOWTO]
*[http://moodle.org/mod/forum/discuss.php?d=39549 LDAP Auto enrollment]
*[http://moodle.org/mod/forum/discuss.php?d=41829 LDAP nightmare Part II]
*[http://moodle.org/mod/forum/discuss.php?d=56198 Moodle + AD + LDAP = Confusion - Help Required and Provided]


[[en:LDAP enrolment]]
[[en:LDAP enrolment]]

Version vom 1. Mai 2012, 07:48 Uhr


Baustelle.png Diese Seite ist noch nicht vollständig übersetzt.

Die LDAP-Einschreibung wird auf der Seite Einstellungen > Website-Administration > Plugins > Einschreibung > Übersicht aktiviert (siehe Einschreibungs-Plugins verwalten) und auf der Seite Einstellungen > Website-Administration > Plugins > Einschreibung > LDAP-Einschreibung konfiguriert.


Dieser Artikel beschreibt, wie die LDAP-Einschreibung in Moodle konfiguriert wird. Die LDAP-Einschreibung funktioniert am besten, wenn auch für die Authentifizierung der Nutzer/innen ein LDAP-Server verwendet wird.

Voraussetzungen

  1. Sie verwenden einen LDAP-Serverals erste Authentifizierungsmethode.
  2. Alle Nutzer/innen haben ein uid Attribut im ihrem LDAP-Nutzer-Datensatz, das mit der Nutzer-ID in ihrem Moodle-Nutzerprofil übereinstimmt.

Beispiel

Wir betrachten das folgende einfache Beispiel:

  • Zwei Kurse Math101 und Eng201.
  • Zwei Trainer/innen TrainerA und TrainerB.
  • DreiTeilnehmer/innen TeilnehmerD, TeilnehmerE und TeilnehmerF.
  • TeilnehmerD und TeilnehmerE sind Teilnehmer/innen im Kurs Math101 und TrainerA ist Trainer/in im Kurs Math101. TeilnehmerE und TeilnehmerF sind Teilnehmer/innen im Kurs Eng201, und TrainerA und TrainerB sind beide Trainer/in im Kurs Eng201.

LDAP-Server-Konfiguration

  1. Definieren Sie zwei LDAP Container ou=TeilnehmerEinschreibung und ou=TrainerEinschreibung.
  2. Für jeden Kurs definieren Sie einen LDAP-Gruppeneintrag (z.B. einen posixGroup Eintrag) in den Containern TeilnehmerEinschreibung und TrainerEinschreibung. D.h. Sie definieren eine Math101 posixGroup unter TeilnehmerEinschreibung und eine Math101 posixGroup unter TrainerEinschreibung. Analog definieren Sie zwei Eng201 Gruppen. Achtung: Der Name der posixGroup muss mit der Kurs-ID des entsprechenden Moodle-Kurses übereinstimmen. Sie dürfen nicht die Kurzbezeichnung des Kurses verwenden - das würde nicht funktionieren!
  3. Tragen Sie die entsprechenden Teilnehmer/innen und Trainer/innen als Mitglieder (member) in den soeben definierten LDAP-Gruppen ein: Tragen Sie das uid Attribut der Nutzer/innen (idnumber) in das memberUid Attribut der entsprechenden Gruppe ein:
    • TrainerA ist Mitglied in der Math101 Gruppe unter TrainerEinschreibung.
    • TeilnehmerD und TeilnehmerE sind Mitglieder der Math101 Gruppe unter TeilnehmerEinschreibung.
    • TrainerA und TrainerB sind Mitglieder der Eng201 Gruppe unter TrainerEinschreibung.
    • TeilnehmerE und TeilnehmerF sind Mitglieder der Eng201 Gruppe unter TeilnehmerEinschreibung.

The LDAP Enrollment Configuration in Moodle

The LDAP enrollment settings in Moodle corresponding to the above setup are as follows:

LDAP Enrollment Variable: Value:
enrol_ldap_student_contexts: ou=StudentEnrollment,dc=ldapserver,dc=tmcc,dc=edu
enrol_ldap_student_memberattribute: memberUid (use 'member' -without the quotes- for Active Directory)
enrol_ldap_teacher_contexts: ou=TeacherEnrollment,dc=ldapserver,dc=tmcc,dc=edu
enrol_ldap_teacher_memberattribute: memberUid (use 'member' -without the quotes- for Active Directory)
enrol_ldap_objectclass: posixGroup (use 'group' -without the quotes- for Active Directory)
enrol_ldap_course_idnumber: cn
enrol_ldap_course_shortname: cn
enrol_ldap_course_fullname: cn
enrol_ldap_autocreate: Yes

Additionally, since you are using LDAP authentication, you should also map the Moodle "ID number" of users to the "uid" in the ldap entry of the user. This is done on the Moodle LDAP Authentication page (not the LDAP Enrollment page).

Automatic course creation

Courses can be created automatically if there are LDAP enrolments to a course that doesn't yet exist in Moodle. To enable this, set enrol_ldap_autocreate to Yes.

enrol_ldap_category field sets the category for the automatically created courses.

enrol_ldap_template field can contain the shortname of a course that is used as a template in the automatic course creation.

Notes:

  1. You do not need to create the courses manually in Moodle. If they don't exist, they will be created when the first enrolled user login.
  2. 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.
  3. 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.
  4. 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).
  5. User passwords for this setup are defined in the attached .ldif file.
  6. If you use the attached .ldif file, you'll need to edit the ldap server information (the "dn=" lines).

Other LDAP Layout

I do suggest to create a new LDAP object, say moodleCourse, which contains all information,& members of the course, including teachers, students a.s.o. For instance (OpenLDAP):

attributetype ( oidAttrBase:44 NAME ( 'teacherUid' ) SUP memberUid
        DESC 'which person is a teacher of this course'
    )


objectclass ( oidObjRoot:14 NAME 'moodleCourse' SUP top STRUCTURAL
        DESC 'course available in Moodle'
        MUST ( cn  )
        MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )
        )

Note: Openldap 2.x will need something like:

attributetype   ( 1.2.1.1.1.1.2.1 NAME 'teacherUid'
                SUP memberUid
                DESC 'which person is a teacher of this course'
                EQUALITY caseExactIA5Match
                SUBSTR caseExactIA5SubstringsMatch
                SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

objectclass     ( 1.2.1.1.1.1.1.1
                NAME 'moodleCourse'
                SUP top STRUCTURAL
                DESC 'course available in Moodle'
                MUST ( cn  )
                MAY ( owner $ gn $ sn $ seeAlso $ description $ memberUid $ teacherUid )
                )

The configuration is like this, in bold you see required changes, in italic you see useful changes.

LDAP Enrollment Variable: Value:
enrol_ldap_student_contexts: ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu
enrol_ldap_student_memberattribute: memberUid
enrol_ldap_teacher_contexts: ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu
enrol_ldap_teacher_memberattribute: teacherUid
enrol_ldap_objectclass: moodleGroup
enrol_ldap_course_idnumber: cn
enrol_ldap_course_shortname: givenname
enrol_ldap_course_fullname: sn
enrol_ldap_course_summary: description
enrol_ldap_autocreate: Yes

Note: The enrol_ldap_course_idnumber (cn in my setup) is used to identify the course by the LDAP enrolment script and the database uses an INTEGER numeric here, in Moodle v1.8 anyway. When you call cd enrol/ldap/ && php -f enrol_ldap_sync.php any course with the same idnumber is updated, hence, it is quite important for the LDAP synchronisation and needs to be unique.

Sample of an moodleCourse LDAP object:

dn: cn=851,ou=moodle,ou=groups,dc=ldapserver,dc=tmcc,dc=edu
objectClass: moodleCourse
cn: 851
givenName: LV851
sn: 2007S/Introduction to Moodle
description: Jahr: 2007 Sommer, <A TARGET=_blank HREF="https://other_server/display/851">Announcement</A>
teacherUid: userA
memberUid: user1

In the same fashion one can add all the other role mappings.

Siehe auch

Diskussionsbeiträge im Kurs Using Moodle auf moodle.org