The profile field mapping works with simple text fields, but not with fields with different LDAP syntax (eg. generalizedTime). Also, $ is not changed into \n for multi-line fields.

This could either be fixed by an optional mangling reg exp for each ldap profile field or preferably by checking the schema for the syntax and mangling accordingly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnbarclay’s picture

I'm up for patches on this to tweak things. I believe to avoid a bunch of hacks that only work for specific fields and mess up the interface, one of the following approaches is best:

1. Leverage the functionality of feeds module. In the long run feeds module is the best way to deal with any complex fields because of tools like feeds tamper and processors already available for more complex fields like taxonomy fields.

2. Use the schema, entity, and field apis to do it well.

noahadler’s picture

Here's a small patch to populate taxonomies, because I needed that functionality. It doesn't follow one of the patterns you mentioned, but might be possible to generalize using the entities interface.

johnbarclay’s picture

Title: Data type mapping for Profile Fields » LDAP User: Data type mapping for Profile Fields
Status: Active » Needs work

I'm ok with this approach for some common field types. To be committed it would need UI documentation and test coverage. I'm trying to avoid adding incomplete features at this point because a release candidate is way overdue and the module is very feature rich with poor documentation and test coverage.

albert9000’s picture

#2 patch worked for me and I'd love to see it committed. Since I don't think anything has been done towards that in the past few months I'm willing to take a stab at it.

If anyone thinks otherwise let me know.

vistree’s picture

Issue summary: View changes

Hi, patch in #2 is very interesting. How can this be expanded so we could map entity reference fields by node title??
In the moment, it is not possible to map a ldap-attribute holding the title of a node referenced through entityreference.

grahl’s picture

Status: Needs work » Needs review
grahl’s picture

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

The patch looks fine and other users can of course make use of it, for inclusion in LDAP and upstream though it's not quite generic enough, thus I'm closing this issue. I'd recommend 7.x users to consider doing this in one of the ldap_user hooks.