Quote:
Originally Posted by rguser
Has anyone conceived of the idea or attempted setting the username to the LDAP 'displayname' or 'givenname' and 'sn' while allowing the user to both login and authenticate using their LDAP credentials? ie, login as: jdoe, but username is set to John Doe so that all posts, member list, user profile and all show John Doe. My forum is internal, consists only of LDAP users all on the same domain and I've disabled registration since the LDAP auth code can create a new user. I've made a user profile field set to displayname but if I don't have to go through and modify the template to show the displayname userfield in lieu of username, that would be awesome.
Unless it's easier now to modify the template using the built-in search/replace? Suggestions or ideas?
|
rguser: Did you ever find a good solution to this? The LDAP passes their employee ID as their user logon (required). But I would rather have all their posts show as their LDAP "displayName."
The closest I got was to modify the
product-ldap_auth-1.5.1_vb4.xml to set the
usertitle to the LDAP
displayName so at least their name is below their employee ID.
I'd like to know how you worked around this.
PHP Code:
} else {
($debug = $debug ) ? print_log("New user. Creating with info from ldap") : false;
$newuser->set('email', strtolower($userData[0]['mail'][0]));
$newuser->set('customtitle', 2);
$newuser->set('usertitle', ($userData[0]['displayName'][0]));
$newuser->set('username', $vbulletin->GPC['vb_login_username']);
$newuser->set('usergroupid', 2);
$newuser->set_bitfield('options', 'adminemail', true);
$newuser->set_bitfield('options', 'emailonpm', true);
$newuser->set_bitfield('options', 'vm_enable', true);
$newuser->set('pmpopup', 1);
$newuser->set('password', $passwd);
$vbulletin->db->query_first_slave("
UPDATE ".TABLE_PREFIX."user
SET ldap=true
WHERE username='". $vbulletin->GPC['vb_login_username'] ."'");