LDAP syncing scripts

General plugins (Local) ::: local_ldap
Maintained by Picture of Charles FultonCharles Fulton, Picture of Andrew ZitoAndrew Zito
This plugin synchronizes Moodle cohorts against an LDAP directory using either group memberships or attribute values.
Latest release:
545 sites
314 downloads
22 fans

This plugin synchronizes Moodle cohorts against an LDAP directory using either group memberships or attribute values. This is a continuation of Patrick Pollet's local_ldap plugin, which in turn was inspired by MDL-25011 and MDL-25054.

This plugin requires that you have either CAS or LDAP enabled as an authentication method. It officially supports OpenLDAP and Active Directory. Both have unit test coverage.

The synchronization tasks are managed as scheduled tasks and are disabled by default.

Screenshots

Screenshot #0

Contributors

Picture of Charles Fulton
Charles Fulton (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Fabian Messing
    Wed, Feb 5, 2020, 6:47 PM
    Hey guys, i dont know if i am right here but in case not, just delete the post.


    Does the plugin consider configurated filters in the ldap authentification and if not how is the best practices then to enroll only a few seperated groups in the moodle?

    Thanks in advnace

    Kindly Regards

    Fabian
  • Picture of Andrew O'Brien
    Wed, Jul 1, 2020, 6:14 PM
    We're running Moodle 3.9 (Build 20200618) with LDAP script 3.6.0 installed. I've just realised that the cohorts aren't syncing. When I go to Scheduled tasks, they're set to disabled and I can't enable them and when I go to view plugins I can't change the settings.

    Any help greatly appreciated! This continues to be an awesome plugin for our school.
  • Picture of Andrew Zito
    Tue, Jul 7, 2020, 2:49 AM
    Hi Andrew,

    Sorry to hear you're having difficulty. Unfortunately I am not able to reproduce the behavior you are describing -- I'm not even sure what circumstances would cause a plugin settings page to be disabled like that. Could you provide some screenshots for us to look at? Maybe we can figure out what's going wrong.
  • Picture of Axel Rezo
    Tue, Jul 21, 2020, 4:49 AM
    Want to tell how i use script and get good result. In AD i use powershell script to add group name to department field in user attribute. in moodle i set 'Attribute name to search' to department and got all group created and user added. Other metod didnt give me good result, and some error.
    And this script didnt work at all using ldap_plus auth plugin(at least may be needed some code editing).
  • Picture of IMMANUEL WONDERFUL
    Tue, Aug 4, 2020, 7:34 PM
    I have installed Moodle 3.9 in the Windows 2019 Server and enabled Active Directory login and it's working fine without any issues. Now I downloaded ldap sync plugin and copied ldap folder to moodle/local and added cli/syc_cohorts.php and sync_cohorts_attribute.php in the Task Scheduler. After run the task scheduler, only 20 cohorts created out of 150 groups and very few of them only added in the cohorts not all the members.
    Group attribute - cn
    Group class - group
    Process nested groups - yes
    Auto create missing cohorts - yes

    Attribute name to search - department

    Axel, could you please help me, I have made the changes as you suggested, but still it is not populating cohorts.
  • Picture of Tobias Marx
    Tue, Sep 29, 2020, 3:51 PM
    Hi! I would like to add all my LDAP users to one cohort. LDAP is working, but I can't get local_ldap to sync anything. It just does nothing when I run the task. A way to debug would greatly appreciated!
  • Picture of Répondant Informatique
    Mon, Oct 5, 2020, 3:16 AM
    Hi!
    We have the same issue than Tobias Marx.
    We suppose that the problem comes after an upgrade to Moodle 3.8. We try to upgrade to Moodle 3.9, we uninstall and reinstall the plugin but nothing is done when the task is running.

    Execute scheduled task: Synchronisation des cohortes sur les groupes du LDAP (local_ldap\task\group_sync_task)
    ... started 21:13:38. Current memory use 13.8Mo.
    ... used 0 dbqueries
    ... used 0.064833164215088 seconds
    Scheduled task complete: Synchronisation des cohortes sur les groupes du LDAP (local_ldap\task\group_sync_task)

    Our configuration is :
    Group attribute - cn
    Group class - group
    Process nested groups - yes
    Auto create missing cohorts - yes

    The LDAP (Active Directory) authentification works well.

    Thanks for your help.
  • Picture of Natalie .
    Mon, Dec 7, 2020, 4:57 PM
    Same here with moodle 3.6!
  • Picture of Andrew O'Brien
    Thu, Jan 7, 2021, 9:26 PM
    I've just realised that our LDAP Sync for groups has stopped working since upgrading to Moodle 3.10 just before Christmas.

    When running the task I get:

    Execute scheduled task: Synchronize cohorts from LDAP groups (local_ldap\task\group_sync_task)
    ... started 13:26:03. Current memory use 13.6MB.
    ... used 99 dbqueries
    ... used 0.11082696914673 seconds
    Scheduled task complete: Synchronize cohorts from LDAP groups (local_ldap\task\group_sync_task)

    ...but no changes are synced. Any help, greatly appreciated.

  • Picture of Charles Fulton
    Thu, Jan 7, 2021, 10:28 PM
    Hi Andrew, I've tested the plugin against Moodle 3.10 and it's still working. What version of PHP do you have and are you on the most recent version of the plugin?
  • Picture of Andrew O'Brien
    Fri, Jan 8, 2021, 12:18 AM
    Thanks for the quick reply, Charles - PHP Version 7.3.25-1 and yes, latest version of the plugin v3.7.0
  • Picture of Andrew O'Brien
    Thu, Jan 28, 2021, 3:55 PM
    I've just started looking over this problem again and noticed I'm getting this error now:

    Scheduled task failed: Synchronize cohorts from LDAP groups (local_ldap\task\group_sync_task),Call to undefined function ldap_connect()

    Any thoughts?
  • Picture of Charles Fulton
    Thu, Jan 28, 2021, 8:59 PM
    That error message suggests that the ldap extension is not enabled on your server.
  • Picture of Andrew O'Brien
    Mon, Feb 1, 2021, 4:17 PM
    Thanks for that... somehow my CLI version of PHP is 7.4 whereas apache2 is using 7.3. I've installed and enabled the ldap module for 7.4 which clears that error, but still no joy syncing groups.
  • Picture of Andrew O'Brien
    Thu, Feb 4, 2021, 4:20 PM
    I've straightened out php to be 7.3 for apache2 and cli, but still not working. The log for the scheduled task reports 99 reads, 0 writes but then Success. The message after the job runs is:

    Execute scheduled task: Synchronize cohorts from LDAP groups (local_ldap\task\group_sync_task)
    ... started 08:19:56. Current memory use 14.5MB.
    ... used 99 dbqueries
    ... used 0.069606065750122 seconds
    Scheduled task complete: Synchronize cohorts from LDAP groups (local_ldap\task\group_sync_task)

    But no cohorts are updated.
1 2 3 4 5
Please login to post comments