summaryrefslogtreecommitdiff
path: root/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-16 06:57:01 -0800
committerEvan Prodromou <evan@status.net>2010-01-16 06:57:01 -0800
commit42550321ffd40328efa8b3bd8ec627ae219cf005 (patch)
tree7556abe8a8d6416b34541e01d098f21959e34b4c /plugins/LdapAuthentication/LdapAuthenticationPlugin.php
parent23a8645a394e2e27997638d03801aab380b84420 (diff)
parent1ef8efe4c5624e7df38ce66187719038594cd828 (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.php16
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(){