Closed (fixed)
Project:
LDAP integration
Version:
5.x-1.3
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2008 at 08:50 UTC
Updated:
5 Dec 2008 at 22:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
cgallo commentedThis is what I did to retreive first name and last name from ldap.
In User management -> Profiles
Create single line textfield fname and lname
Under site configuration -> ldapdata
Map the drupal attributes to the ldap attributes
profile_fname to givenName
profile_lname to sn
Once data is mapped you can reference it a
$user->profile_fname
$user->profile_lname
Hope this helps.
cg
Comment #2
kk1 commentedi configure ldap successfully and integrated with my organisation's Active directory,when the users login the site its displaying employ id which i would like to replace with the user's first name .How can i do it. Help me out!! here is snap shot chk out the sidebar login.
the above code i worked out but i did not understand where to add.
$user->profile_fname
$user->profile_lname
Comment #3
cpugeniusmv commentedYou'll need to override theme_username in your theme's template.php file.
http://drupal.org/node/11811
http://drupal.org/node/55126
Comment #4
Panda_N_Shark commentedHy there,
Can you put a pic how to configure
Under site configuration -> ldapdata
Map the drupal attributes to the ldap attributes
profile_fname to givenName
profile_lname to sn
I try different ways... but the fields never get values :s
Comment #5
scafmac commentedHere's an image - why don't you describe what you've tried - I'm not sure how cpugeniusmv did it, but this image shows how we've configured a similar setup.
What we did here is:
* create two new profile fields: profile_alumni_id & profile_alias
* entered their LDAP attribute names: employNumber & alias
* and indicated above that any updates should be saved to LDAP
You'll also notice mail, pass, & signature are listed - those are default drupal fields, but you still need to specify what LDAP attribute you map to. In our situation, we completely ignore the ldapdata.conf.php file. We also ignore the bottom section.
This module is a bit of a mess - let me know how it goes.
I've found that occasionally, when it just will not work as expected, selecting the 3rd radio button & starting over works helps.
Regards
Comment #6
scafmac commentedOh yeah - you also probably need to define an administrative DN & password in the advanced section of the ldapdata admin page. Is there anything in the log about errors? Both the Drupal log & the web server log.
Comment #7
Panda_N_Shark commentedI there!
Thanks for the pic, what i want is that, i only want the fields to get data from ldap to drupal... but when i do update i get the folloing errors:
* warning: array_filter() [function.array-filter]: The first argument should be an array in /media/WORK/www/drupal/modules/ldap_integration/ldapdata.module on line 373.
* warning: array_filter() [function.array-filter]: The first argument should be an array in /media/WORK/www/drupal/modules/ldap_integration/ldapdata.module on line 382.
By the way, i still have the profile module return errors on first login...
Thanks for the help
Comment #8
scafmac commentedAnyone looking for the solution to the original issue - use comments #1 & #3.
Hey Panda_n_Shark,
With errors like that, I think you should create a new issue, unless you can find a similar one to comment on. Either way, this one isn't it.
With that said, if you are having problems with the profile module, the ldap data module will not work correctly. You said you had profile errors first. Try turning off the ldap groups module and get the profile module working by itself first. Now the DB might be fubared, in which case, you should uninstall the ldap groups module before re-enabling it.
Good luck
Comment #9
coderintherye commentedOh man! I wish I had seen this thread last month when I was recreating the solution. However, here is an alternative, programmatic way that could be implemented grab those name attributes within the module.
In discussion around the original point of this thread, in order to get the CN name, I did the following changes to the ldapdata.module file.
Lines 707 - 719 of the original ldapdata.module file (at the end of the ldap_user_view function) are as follows:
On the blank line of 715 between the } closing the if statement and the $ldapdat_ldap->disconnect(); I added the line
(by the way it took a really long time to figure out that is where the data was coming from)
Now the problem here is that the array number of the attribute for the full name could vary widely depending on what your setup is in your LDAP, but maybe we could check the attribute name or something and then if it is name assign it to a name variable automatically.
Considering the original issue of this thread got derailed, a potential solution (although not complete) was posted, and I want to further discuss completely the mapping of the user name, I am closing this issue, and starting a new issue.