Authentication

LDAP Auth data mapping custom user fields

 
 
Picture of Lael ...
Re: LDAP Auth data mapping custom user fields
 

I'm also trying to make this work and having trouble with it. The latest issue is that the mappings simply don't 'stick' on the LDAP page - they just vanish after putting in the required AD field name.

Has anyone got this working reliably?

 
Average of ratings: -
Picture of Michael O'Brien
Re: LDAP Auth data mapping custom user fields
 

While it might be too early to say if they will stick around but in Moodle 2.7 I was able to get custom user profile fields to sync from ldap and use a custom category after they initially didn't work for me.


To undo (as mentioned above) existing non-working customer user fields

  1. remove any data mapping in place in the ldap settings for your custom profile field
  2. remove the fields from users -> accounts - User Profile Fields
  3. remove the custom category (if you had them)
  4. Purge all cache (just to be sure)
  5. Go back to the ldap data mapping page in Plugins -> Auth ->Ldap server -> data mapping and confirm your old fields are gone
  6. Add your custom category
  7. Add your custom fields in users -> accounts - User Profile Fields but remember
    1. Use lowercase values for the shortname and probably best to avoid spaces etc.
    2. I used the text input field type so can't comment on anything else working
  8. Go back to the ldap server settings and re-map your ldap field to your custom field, I used an extra field to sync with a value I already knew worked in the non-custom fields to rule out any possible issue of my ldap not sending the right field or an issue with using a custom category
  9. Set the field to update at login and logout and back in again to verify it worked (if your account is set to use ldap of course)


 
Average of ratings: -
Picture of Michael O'Brien
Re: LDAP Auth data mapping custom user fields
 

Also not sure but assume if a data mapping field generates too many errors it gets removed from the ldap mapping as 1 mapping was removed while another survived an execution of ldap sync users

 
Average of ratings: -
Picture of Olumuyiwa Taiwo
Re: LDAP Auth data mapping custom user fields
 

This doesn't work for me when I run sync_users.php from the command line or as a cron job, but seems to work when users login.

I have two custom profile fields -- text format, lowercase shortnames. LDAP server setting "Update local" is set to "On every login" for the custom fields.

I had a look at the sync_users() function in auth.php but can't locate where it actually updates the custom profile fields. There's  a call to update_user_record() which in turn calls user_update_user() which updates only the user table. I can't find where it updates the user_info_data and user_info_field tables.

What am I missing?

 
Average of ratings: -