I'm syncing users from an Active Directory to Drupal from 3 different locations within the AD. To do this I've created 3 separate LDAP queries. Based on the query that is being run, I need to set extra meta information on my entity. Now, when calling hook_ldap_user_edit_user() I don't seem to be able to get the config of the call that is being made. So I don't seem to be able to get which ldap query actually is being run.

Probably the correct solution would be to update the form admin/config/people/ldap/user to accept multiple ldap queries under "PERIODIC USER UPDATE MECHANISM".

Comments

iSoLate created an issue. See original summary.

isolate’s picture

For now I just give the data to the context in the alter hook. This seems to be the quickest solution.

grahl’s picture

Version: 8.x-3.0-beta7 » 8.x-4.x-dev
Status: Active » Needs work

I don't quite see why we'd need to pass the config along as raw data but I'm not opposed to passing the config if it enables this particular use-case.

I'd consider multiple queries on the periodic update mechanism out of scope for now and recommend to do this in custom code if the need arises.

grahl’s picture

Status: Needs work » Closed (won't fix)

This is not something we do for the other hooks, so I consider it outside of the scope of the core module and would recommend for a custom patch, overriding the orphanprocessor generally or even a separate contrib module.

Feel free to reopen if you have a good reason why we should generally add this.