As currently written the LDAP Sync reads all of the users from all of the servers but it only uses the users from the last LDAP server when performing its sync. The attached patch corrects this error and causes the sync to use all of the data it collected from all of the servers.

Comments

cgmonroe’s picture

Status: Needs review » Needs work

This patch only partially fixes the problem being addressed.

The current code does not pass back the ldap server id in the discovered user data. Instead, when a user is create in the _ldapsync_sync() function, it uses the current _ldapsync_ldap object with only has the last sid as the user's ldap_config property. So this patch will cause users to be created with the wrong ldap_config settings.

To correctly fix this problem, the $user array created in the _ldapsync_search() function should include the SID it was found in. This should be used when the user was created.

antgiant’s picture

Title: LDAP Sync only Synchronizes Last Server » LDAP Sync Broken with Multiple Servers
Status: Needs work » Needs review
StatusFileSize
new3.13 KB
new1.1 KB

You're right I hadn't even noticed that. The sid issue combined with the resetting $user variable means that the sync module is pretty much guaranteed to do the wrong thing in a Multi-Server Setup. Changing issue title to reflect that.

Attached two patches. First is same as before and fixes $user bug. Second attempts to fix the $sid bug. At the moment untested but I believe it is correct.

cgmonroe’s picture

Status: Needs review » Fixed

This was fixed with the changes just committed.

See: #1475272: 6.x-1.0 Release Candidate 1 Status for details.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.