This module is working great, I have it authenticating with our AD and can use the LDAP attribute mapping to pull phone, email and department information that can be viewed in the 'My account' page.

What I'd like to do now is use this information to pre-populate fields in a CCK form I have created. Is this possible ? If it is, how do you do this ?

Thanks in advance for any help you can give.

Comments

miglius’s picture

LDAP integration can sync LDAP data with users' profiles. You should write your own module which takes data from the profiles and pre populate cck fields.

miglius’s picture

Status: Active » Closed (won't fix)
whitingx’s picture

Thanks very much for your help with this.

I've synced the relevant LDAP data with the user profile fields and got them to display in the CCK fields using the following default value PHP code;

global $user;
if ($user->uid) {
profile_load_profile($user);
return array(
   0 => array('value' => $user->profile_ad_firstname),
 );
}

Is there a way to combine my profile_ad_firstname with my profile_ad_surname to automatically add the users full name to the CCK field ?

Thanks very much.

whitingx’s picture

Status: Closed (won't fix) » Active
miglius’s picture

From your code the context is unclear. Why can't you change
$user->profile_ad_firstname to a $user->profile_ad_firstname .' '. $user->profile_ad_surname?

miglius’s picture

Status: Active » Closed (won't fix)

I'm changing status to won't fix as this is not related to ldap* modules.

whitingx’s picture

$user->profile_ad_firstname .' '. $user->profile_ad_surname

Fantastic, worked perfecly, thank you very much for all your assistance with this.

whitingx’s picture

Status: Closed (won't fix) » Closed (fixed)