Hinweis: Sie sind auf den Seiten der Moodle 1.9 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Kurseinschreibung über LDAP.

Kurseinschreibung über LDAP: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
K (hat „Einschreibung über LDAP“ nach „Kurseinschreibung über LDAP“ verschoben)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
{{Zum Übersetzen}}
{{Zum Übersetzen}}
Siehe [[:en:LDAP enrolment]]
Siehe [[:en:LDAP enrolment]]
{{Gisela}}


[[Category:Administrator]]
[[Category:Administrator]]

Version vom 30. September 2009, 07:49 Uhr

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

Siehe en:LDAP enrolment

Baustelle.png Diese Seite wird derzeit von Gisela Hillenbrand bearbeitet. Bei Änderungsvorschlägen nehmen Sie bitte direkt Diskussion.

Location: LDAP edit settings link in Administration > Kurse > Einschreibung


Wie man das Einschreiben in einen Kurs via LDAP einrichtet

Hier wird beschrieben, wie man LDAP-Einschreibung einrichtet (erste Version von Lars Jensen). Einschreibung über LDAP arbeitet am besten, wenn in Moodle ebenfalls Authentifizierung über LDAP genutzt wird. Entsprechend gehe ich davon aus, dass Sie bereits LDAP-Authentifizierung eingerichtet haben. Für Schulen kann ich nur dringend dazu raten, einen LDAP-Authentifizierung plus LDAP-Einschreibung einzurichten. Der administrative Aufwand sinkt dadurch auf ein Minimum, während gleichzeitig weniger Fragen von Lehrern und Schüler zu erwarten sind.


Das Ziel

Ihr M$-2K3-Server kennt Klassen, denen Schüler zugeordnet sind. Sie wollen,

  1. dass Moodle automatisch einen Klassenraum einrichtet, sobald ein Schüler der Klasse sich einloggt.
  2. dass jeder Schüler einer Klasse automatisch freien Zutritt zu seiner Klasse hat, ohne administratives Zutun.

Möglicherweise wollen Sie auch, dass auch Lehrer automatisch ihrer Klasse zugeordenet werden. Das klappt natürlich nur, wenn LDAP diese Information auch tatsächlich abbildet. Bei uns ist das nicht der Fall, was aber meines Erachtens vollkommen unproblematisch ist. Ohnehin lege ich die Lehrer alle per Bulk-Upload an,

  1. weil das schnell gemacht ist,
  2. weil ich so alle Lehrer in Moodle erfasst habe, auch wenn sie noch nicht in Moodle angemeldet waren. So kann i beispielsweise vorm ersten Login Lehrer in gewünschten Kursen einschreiben,
  3. weil Single-Sign-In natürlich trotzdem prima funktioniert, auch wenn die Lehrer über eine Textdatei angelegt wurden.

Annahmen

  1. Ich habe die Einschreibung über LDAP auf Moodle 1.9.2 getestet. Andere Versionen sollten auch klappen.
  2. Sie nutzen bereits LDAP-Authentifizierung.
  3. Meine Angaben beziehen sich leider nur auf einen M$ W2k3-Server. Alternative LDAP-Server werden bestimmt auch funktionieren, aber möglicherweise nicht so wie hier beschrieben.
  4. Jeder User hat eine eindeutige ID-Nummer. Um das sicherzustellen gehen zur LDAP-Authentifizierung und geben Sie ganz unten im Bereich "Data Mapping" unter ID-Nummer "distinguishedName" ohne Anfürungszeichen ein (Siehe Abbildung). Im Falle von OpenLDAP (und anderen RFC2307 kompatiblen LDAP-Servern sollte hier "cn" zielführend sein.


ID-nummer.jpg

Das Aussehen der Kurse

Unser Setup schließt folgende Kurs- und Nutzerangaben ein:

  • Zwei Kurse, Math101 und Eng201.
  • Zwei Lehrer, LehrerA und LehrerB.
  • Drei Schüler, SchuelerD, SchuelerE und SchuelerF.
  • SchuelerD und SchuelerE sind als Schüler im Kurs Math101 eingeschrieben, LehrerA ist als Lehrer im Kurs Math101 eingeschrieben. SchuelerE und SchuelerF sind als Schüler im Kurs Eng201 eingeschrieben,

LehrerA und LehrerB sind als Lehrer im Kurs Eng201 eingeschrieben.

The LDAP Container Setup

  1. Define two LDAP containers ou=StudentEnrollment and ou=TeacherEnrollment
  2. 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, the name of the posixGroup has to match the Course ID number of the Moodle course. Do not use the course short name, it will not work.
  3. 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:
    • TeacherA is a member of the Math101 group under TeacherEnrollment.
    • StudentD and StudentE are a members of the Math101 group under StudentEnrollment.
    • TeacherA and TeacherB are members of the Eng201 group under TeacherEnrollment
    • StudentE and StudentF are a members of the Eng201 group under StudentEnrollment.

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).

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.

See also