The following steps assume you already have moodle LDAP auth configured and are running the /auth/ldap/cli/sync_users.php to sync LDAP users to moodle.
1. Obtain the sync_cohorts.php script from https://tracker.moodle.org/browse/MDL-25011?attachmentOrder=desc and place it in /auth/ldap/cli/
2. Add the following lines to moodle's config.php
$CFG->ldap_group_class='group';ldap_group_class - needs to be set to 'group' for active directory in order to match user groups
$CFG->ldap_process_nested_groups=1;
$CFG->ldap_real_user_attribute='sAMAccountName';
ldap_process_nested_groups - set this to 1 if you have groups as members of your groups in order to locate the actual users
ldap_real_user_attribute - this is probably whatever you have "User attribute" set to in moodle's LDAP settings. Also note that it is CASE SENSITIVE (that one gave me some trouble until I realized what the issue was).
3. Add the sync_cohorts.php scrip to your webserver user's crontab to be run sometime after the ldap sync_users.php finishes.
4. Add the newly created cohort to your course using the cohort-sync enrollment type.
Hi Stephen. Wolfreton School thanks you for this post! ;-)
ReplyDeleteHello, just got the following error, searched the web for ours but have no idea, can you help? Did you have any idea?
ReplyDeletetraitement du groupe Medien
creation cohorte 0
Default exception handler: Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. Debug:
Error code: codingerror
* line 1490 of /lib/deprecatedlib.php: coding_exception thrown
* line 347 of /auth/ldap/cli/sync_cohorts.php: call to textlib_get_instance()
* line 540 of /auth/ldap/cli/sync_cohorts.php: call to auth_plugin_cohort->ldap_get_group_members_ad()
* line 653 of /auth/ldap/cli/sync_cohorts.php: call to auth_plugin_cohort->ldap_get_group_members()
!!! Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. !!!
best regards
Jörg
Hello, just got the following error, searched the web for ours but have no idea, can you help? Did you have any idea?
ReplyDeletetraitement du groupe Medien
creation cohorte 0
Default exception handler: Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. Debug:
Error code: codingerror
* line 1490 of /lib/deprecatedlib.php: coding_exception thrown
* line 347 of /auth/ldap/cli/sync_cohorts.php: call to textlib_get_instance()
* line 540 of /auth/ldap/cli/sync_cohorts.php: call to auth_plugin_cohort->ldap_get_group_members_ad()
* line 653 of /auth/ldap/cli/sync_cohorts.php: call to auth_plugin_cohort->ldap_get_group_members()
!!! Fehler in der Kodierung gefunden, den nur ein Programmierer korrigieren kann: textlib_get_instance() can not be used any more, please use core_text::functioname() instead. !!!
best regards
Jörg
I am also getting same error and i have Moodle 3.3
ReplyDeletetraitement du groupe Exchange Servers
Default exception handler: Coding error detected, it must be fixed by a programm
er: textlib_get_instance() can not be used any more, please use core_text::funct
ioname() instead. Debug:
Error code: codingerror
* line 1208 of \lib\deprecatedlib.php: coding_exception thrown
* line 347 of \auth\ldap\cli\sync_cohorts.php: call to textlib_get_instance()
* line 540 of \auth\ldap\cli\sync_cohorts.php: call to auth_plugin_cohort->ldap_
get_group_members_ad()
* line 653 of \auth\ldap\cli\sync_cohorts.php: call to auth_plugin_cohort->ldap_
get_group_members()
!!! Coding error detected, it must be fixed by a programmer: textlib_get_instanc
e() can not be used any more, please use core_text::functioname() instead. !!!