Closed (fixed)
Project:
LDAP provisioning
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 May 2009 at 15:40 UTC
Updated:
26 Apr 2014 at 14:20 UTC
Jump to comment: Most recent
Comments
Comment #1
miglius commentedThere is no ldapprov.conf.inc file any more in the dev version. Custom fields are configurable from the module settings page.
Comment #2
matt v. commentedCan someone provide a bit more detail on how to add custom fields? For backwards compatibility reasons, I need to add a custom salted password field to LDAP that users should not see or be able to edit. I need the salted password to be stored when a user gets created and updated if a user changes their password. I have a handle on getting the password and salting it the way I need it, but I'm not sure how/where I go about adding it to LDAP.
Comment #3
Nr. 18 commentedIn the 6.x.-1.0-beta1 release you goto: /admin/settings/ldap/ldapprov
There you will find a fieldset: "Registration form" with "Custom elements" there you can add a custom field to the registration form:
sponsor|type=>textfield|title=>Sponsor POC|weigth=>4|size=>64|maxlemgth=>64|required=>1|description=>Sponsor Point of Contact.And than you add the following to the "LDAP attributes"
<ldapattribute_name>: !custom_sponsorAs you can see the field called !custom_<custom name>
Comment #4
madhusudan commented@ Nr. 18
its not working.
ldapattribute_name: !custom_sponsor
i tried some combinations
like
ldapattribute_name: %custom_sponsor
ldapattribute_name: !sponsor
ldapattribute_name: %sponsor
although its adding in ldap server with the name itself(!custom_sponsor) ,not the exact value.
I am using drupal-6.15 with ubuntu 9.10 karmic and LDAP server is a fedora version.
Comment #5
madhusudan commentedhmm i cant wait anymore.
finally got it working after digging the code .
in ldapprov.module after line number 1860 (don't know exactly but after this line )
$ldap_vars['!pass'] = $pass_ldap;I added
$form_custom = variable_get('ldapprov_custom', array());
foreach ($form_custom as $custom_name=>$field)
{
$ldap_vars['!'.$custom_name] = isset($data[$custom_name]) ? $data[$custom_name] : NULL;
}
and it's working perfectly.
and rest is same as Nr. 18 said .
Note: I have tested only for only Custom elements which are defined in ldapprov registration form.
but was not working with Profile integration. lets see if someone can contribute that code
I hope the author will add this code in next version.! :-)
Comment #6
terminus commented*shrug* worked for me. Maybe you didn't realise that "ldapattribute_name" is a placeholder, and that you actually have to put, um, your attribute name. For example:
o: !custom_o
Comment #7
vincetingey commentedI too was unable to get this to work for me.
Yes I double checked that I was using the correct syntax:
attribute: !custom_customfieldname
Comment #8
john franklin commentedThe 2.x branch includes
hook_ldapprov_custom_attributes_alter(&$ldap_vars, $account)so you can add entries of the form $ldap_vars['!my_custom_attribute'] from your own custom module.