Template moodle plugin to allow multiple instances of auth_ldap_syncplus - this is forked from Moodle LDAP Instances:
In some installations, it is desirable to support multiple configurations of the LDAP plugin. Two particular use cases are
-
You are using multiple LDAP servers for managing accounts. Create a second instance of the LDAP auth plugin, and configure it independently. To Moodle, these two LDAP servers will appear as separate authentication methods.
-
You want certain settings to apply only to selected user. For example, you might want automatically to import all students into Moodle, but create staff accounts only manually, or only when they login first.
This plugin uses auth_ldap_syncplus as its basis. It should be straight-forward to adjust to the standard LDAP plugin.
-
Create a git clone of this repository (https://github.com/loewis/moodle-auth_ldap_instances.git). Clone it into the auth subdirectory, giving it a name of your choice (eg. ldap_external, or ldap_students). We assume 'ldap_students' for further discussion.
-
Change into the ldap_students directory.
-
In version.php and auth.php, replace 'auth_ldap_instances' with 'auth_ldap_students', in the component name variable, the class name, and the instancename variable
-
Copy lang/en/auth_ldap_instances.php to lang/en/auth_ldap_students.php. You might want to edit the strings in it as well.
-
Log into Moodle as an administrator, and activate the authentication method.
-
If you want to have existing accounts LDAP accounts moved to the new method, you need to perform an update in the database, or convert each account manually. To convert ALL LDAP accounts automatically, do
update mdl_user set auth='ldap_students' where auth='ldap';
Please submit bug reports to https://github.com/loewis/moodle-auth_ldap_instances/issues
This code was written by Martin v. Löwis [email protected]. See COPYING.txt for license conditions.