Auto enrolment Students / teachers in the same OU

Auto enrolment Students / teachers in the same OU

by mathieu doe -
Number of replies: 2
Hi,

I'm new in Moodle and LDAP smile

I have 2 questions.

1- Is it possible to map students context and teachers context which are in the same OU ?

Exemple :
enrol_ldap_student_contexts: ou=groups,dc=ldapserver,dc=tmcc,dc=edu

enrol_ldap_student_memberattribute: memberUidStudents

enrol_ldap_teacher_contexts: ou=groups,dc=ldapserver,dc=tmcc,dc=edu

enrol_ldap_teacher_memberattribute: memberUidTeachers

2- In this OU I have some CN that aren't meant to be Courses. Can I filter my request in order not to have these CNs?

Kind regards
რეიტინგების საშუალო: -
In reply to mathieu doe

Re: Auto enrolment Students / teachers in the same OU

by mathieu doe -
I have found the way to filter my request. I have to use the "enrol_ldap_objectclass"

Can you just tell me if my value is correct (i cannot test it for now) ?

(&(objectClass=posixGroup)(!(|(cn=aaaaaa)(cn=building1)(cn=building2)(cn=building3))))

I use an openLDAP.

Thanks

Kind regards
რეიტინგების საშუალო: -
In reply to mathieu doe

Re: Auto enrolment Students / teachers in the same OU

by mathieu doe -
finally smile

You have to change on line 511 in enrol.php (enrol/ldap/)

$ldap_search_pattern='(&(objectclass='.$CFG->enrol_ldap_objectclass.')'.$ldap_search_pattern.')';

to

$ldap_search_pattern='('.$CFG->enrol_ldap_objectclass.$ldap_search_pattern.')';

In fact, you can now use a search pattern more powerful.

Kind regards
რეიტინგების საშუალო: -