The current dev version has support for using the Content Profile project with users as defined in issue:

#646640: Support "Content Profile" module (in addition to core Profile module)

This works fine with the exception of this problem:

#1253020: $profile_fields / $content_profile_fields messed up in ldapdata.module

However, while the current dev version supports mapping ldap attributes into content profile node fields, it does not support allowing users to update ldap attributes when they are modified in Drupal. E.g., the Drupal User Profile Field mapping option set to read/write.

Since I needed this functionality, I have been working on adding it to ldapdata. It is now ready for review and a patch to add this functionality will be attached below.

The method used to do this was to implement some hook_nodeapi update option code that monitored for profile content types and then updates LDAP attributes defined in the LDAP Data admin screen. Basically a rehash of the user_submit code.

While doing this, I also found some performance problems with the original version. This was coded so that the content profile nodes were loaded and saved for each attribute. The existing content profile related user_load code has been re-factored so that nodes will only be loaded once and only saved if there is a change.

Note that the "save only on change" is also needed to prevent "Node modified by another users" errors when editing Content Profile nodes. I.e., if the user_load function updated the node from ldap on each page load, the node changed timestamp would be newer than the form's.

This also adds support for CCK e-mail fields (e.g. Having an optional "published" e-mail address in the profile node mapped to an attribute).

This also contains the fix for #1253020: $profile_fields / $content_profile_fields messed up in ldapdata.module .

There is also a fix for a PhP "implode() [function.implode]: Invalid arguments passed" error that can occur if there are no standard Drupal profile fields.

Finally, there are some changes to make Coder happy with the ldapdata.module file. E.g., missing spaces; else if => elseif; and a few "check_plain" functions added to titles and descriptions.

Patch to be attached in comment once I have issue number.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cgmonroe’s picture

Here is the patch described above. It's based on the current 6.x-1.x branch.

cgmonroe’s picture

Here's a new patch that includes some fixes for bugs we have found. This is a full replacement for the patch above. E.g., it makes the changes the initial patch does, plus:

- Now creates the content profile nodes properly when a new user is created by ldapauth and syncing is required.
- Now supports having multiple content profile node types. Lists them in the ldapdata server admin screen as node type->field
- Fixes implode function error in _ldapdata_user_update_profile that occurs if no Profile module fields are define.

This is still based on the current 6.x-1.x branch.

cgmonroe’s picture

Status: Needs review » Fixed

Committed to dev release.

Status: Fixed » Closed (fixed)

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