diff options
author | Evan Prodromou <evan@status.net> | 2010-01-16 06:57:01 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-16 06:57:01 -0800 |
commit | 42550321ffd40328efa8b3bd8ec627ae219cf005 (patch) | |
tree | 7556abe8a8d6416b34541e01d098f21959e34b4c /plugins/LdapAuthentication/LdapAuthenticationPlugin.php | |
parent | 23a8645a394e2e27997638d03801aab380b84420 (diff) | |
parent | 1ef8efe4c5624e7df38ce66187719038594cd828 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/LdapAuthentication/LdapAuthenticationPlugin.php')
-rw-r--r-- | plugins/LdapAuthentication/LdapAuthenticationPlugin.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index eb3a05117..1755033f1 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -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(){ |