Thought I'd throw this out there for everyone's consideration. We're looking at using vBulletin for our intranet, so LDAP became very important. What also became important is that we remove any hint of anonymity. My LDAP ID, for instance, is A000657 - which says nothing about who I am. It would be far better if my full name appeared in my profile somewhere.
So here's what I did. I added a bit of code to controller.php that would retrieve my full name, location, and title from LDAP and stick them in the additional user profile fields. Then I went into the Admin CP and made sure the user can not modify these fields. Here's what the code looks like. The attributes "l", "title", and "fullName" may be different in your configuration.
PHP Code:
// get the email address from ldap
$ldapConnection = ldap_connect($ldapServer, $ldapPort);
if($ldapConnection)
{
$searchEmail=ldap_search($ldapConnection, $ldapBase, $ldapFilter, $ldapEmailAttr);
$userEmail=ldap_get_entries($ldapConnection,$searchEmail);
if(sizeof($userEmail) < 2)
{
$newuser->set('email', $noEmailExists);
}
else
{
$newuser->set('email', $userEmail[0]['mail'][0]);
}
// ---- Modified by Mark Tomlinson - 10/15/2007 ----
// get user attributes from ldap
$searchField = ldap_search($ldapConnection, $ldapBase, $ldapFilter);
$userAttributes = ldap_get_entries($ldapConnection, $searchField);
// set fields
$vbulletin->GPC['userfield']['field2'] = $userAttributes[0]['l'][0];
$vbulletin->GPC['userfield']['field4'] = $userAttributes[0]['title'][0];
$vbulletin->GPC['userfield']['field5'] = $userAttributes[0]['fullname'][0];
$newuser->set_userfields($vbulletin->GPC['userfield'], true, 'admin');
// ---- End Modifications ----
}
ldap_close($ldapConnection);
Next up - plugging the full name and title in the signiture field.