Add nickname suggestion capability for use during autoregistration.

This commit is contained in:
Craig Andrews
2010-01-14 19:43:03 -05:00
parent c82c43d5ee
commit a27aef9206
2 changed files with 60 additions and 12 deletions

View File

@@ -153,6 +153,22 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
return false;
}
function suggestNicknameForUsername($username)
{
$entry = $this->ldap_get_user($username, $this->attributes);
if(!$entry){
//this really shouldn't happen
return $username;
}else{
$nickname = $entry->getValue($this->attributes['nickname'],'single');
if($nickname){
return $nickname;
}else{
return $username;
}
}
}
//---utility functions---//
function ldap_get_config(){